1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
template <typename f,typename reg,typename id ,typename mod>
class datos{
public:
f dato;
reg tipo;
id id_reg;
mod modif;
datos(f vdato,reg tipo_dato,id tid_reg,mod tid_modif)
{dato=vdato;
tipo=tipo_dato ;
id_reg=tid_reg;
modif=tid_modif;}
};
int main() {
int entero=43;
int identificador=99;
float d=98.7645;
int* a;
a=&entero;
int* i;
i=&identificador;
datos <int,char,int,char> mi (*a,'c',*i,'n');
datos <float,char,int,char> mi2 (d,'c',*a,'n');
cout<<mi.dato<<endl;
cout<<mi.tipo<<endl;
cout<<mi.id_reg<<endl;
cout<<mi.modif<<endl;
cout<<mi2.dato<<endl;
cout<<mi2.tipo<<endl;
cout<<mi2.id_reg<<endl;
cout<<mi2.modif<<endl;
vector <datos<float,char,int,char> > mivector (2);
return 0 ;
}
|