Ex:
union test
{
unsigned long Count;
unsigned long Size;
char* Name;
unsigned short Len;
};
int main()
{
test ut;
ut.Count = 20;
ui.Size = 15;
ui.Name = (char*)malloc(5);
strcpy_s(ui.Name, 4, "test");
ui.Len = 15;
free(ui.Name);
return 0;
}
Now are there all stored in the same memory location?
Ex:
Count Size Name Len 00 00 00 20 00 00 00 15 xx xx xx xx 00 00 15

New Topic/Question
Reply




MultiQuote




|