explain about storage of union elements.
Answers were Sorted based on User's Feedback
Answer / anandi
Union elements can share the common memory spaces.
For eg.
union stu
{
int rno;
int mark;
float total;
};
In this pg, the compiler allocates 4 bytes to store the
union members. Bcoz, in this pg, the float data type only
requires the large memory size, ie, 4 bytes. And the
remaining members can share this 4 bytes. So if u want to
store rno, it will allocate the first 2 bytes.
And also we can store only one value at a time to the
memory.
| Is This Answer Correct ? | 6 Yes | 0 No |
If errno contains a nonzero number, is there an error?
What is a newline escape sequence?
Which function in C can be used to append a string to another string?
What is static memory allocation?
What is getch?
What is scanf_s in c?
What is a null pointer in c?
explain what are pointers?
what is output? main() { #define SQR(x) x++ * ++x int i = 3; printf(" %d %d ",SQR(i),i * SQR(i)); } a)9 27 b)35 60 c)20 60 d)15 175
char ch=10;printf("%d",ch);what is the output
why we wont use '&' sing in aceesing the string using scanf
Why do we use static in c?