C Programming - Structures, Unions, Enums - Discussion

Discussion Forum : Structures, Unions, Enums - Yes / No Questions (Q.No. 5)
5.
A pointer union CANNOT be created
Yes
No
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
16 comments Page 2 of 2.

CBee said:   1 decade ago
It is possible to create union of pointers
union u{
int *p;
int *q;
char r[4];
};

Shanmuk said:   1 decade ago
No clarity.

Divya said:   1 decade ago
Can anyone explain with an example ?

Sachin said:   1 decade ago
It is having only one address ie longest size of data member then no need to have the pointer...

Vinay said:   1 decade ago
I am confused about the answer but it may be correct.

As union size is the size of its longest variable and all members access the same memory no need of assigning a pointer as we have only one memory address.

Niraimathi said:   1 decade ago
Can any one explain it why?


Post your comments here:

Your comments will be displayed after verification.