Hi,
I have some experience in C prog language. I have small doubt abt
using unions in C language.
I have the foll. union
union MyUnion
{
char name [100];
double dblval;
int intVal;
};
Since all the members of union share the same memory space, if we set
the value of one union members, it overwrites the other field's value.
How do the OS maintain that a particular member is set and not the
other member.
Say like, I use
MyUnion ux;
strcpy(ux.name, "C Language"); /* name is set */
/* try to overwrite name field */
ux.intVal = 0xFF6677;
Now at this time how does OS maintains that intVal is now used... !!!!
Also, if I now try to print name field, what it shld be ??
Pls reply in ur FREE time..there is no urgency..
sumit