J
jonnychang
What is the purpose of using union in this class?
Class A {
public:
union {
int age;
char * name;
double amount;
}
};
Can I use struct instead of union? Is there are any advantage of using union
in here?
Thanks in advance...
-Jonny
Class A {
public:
union {
int age;
char * name;
double amount;
}
};
Can I use struct instead of union? Is there are any advantage of using union
in here?
Thanks in advance...
-Jonny