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 |
write a programme that inputs a number by user and gives its multiplication table.
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }
What is dangling pointer in c?
Is anything faster than c?
no consistent academics. how to answer the question
What is the right type to use for boolean values in c? Is there a standard type?
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
Differentiate between the expression “++a” and “a++”?
what is const volatile?
What is the meaning of this decleration? unsigned char (*pArray[10][10]); please reply.
Can a local variable be volatile in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9