K
KK
Hi,
How can I create alias for a class object? Please go thru this
program to understand the motivation.
Class Name;
Class Country{
Name list[10];
/*My intension is to have:
list[0] - usa
list[1] - uk
list[2] - ..
*/
//define other essential member functions
void PrintMyself (void );
}
void Country:rintMyself()
{
for (int i=0;i<10;i++)
//print the entire array :: makes my life so easy with
indexing
}
void somefunc(Country& ex)
{
Name usa_country;
usa_country =ex.list[0]; //indexing is no good here - I wish I had
the alias for list[0] as usa
}
Hoping to get the answer.
Thank you.
KK
How can I create alias for a class object? Please go thru this
program to understand the motivation.
Class Name;
Class Country{
Name list[10];
/*My intension is to have:
list[0] - usa
list[1] - uk
list[2] - ..
*/
//define other essential member functions
void PrintMyself (void );
}
void Country:rintMyself()
{
for (int i=0;i<10;i++)
//print the entire array :: makes my life so easy with
indexing
}
void somefunc(Country& ex)
{
Name usa_country;
usa_country =ex.list[0]; //indexing is no good here - I wish I had
the alias for list[0] as usa
}
Hoping to get the answer.
Thank you.
KK