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 |
What are the advantage of c language?
What is character constants?
What is assert and when would I use it?
What are the characteristics of arrays in c?
void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case
what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
How can I insert or delete a line (or record) in the middle of a file?
Write a program to reverse a string.
0 Answers Global Logic, iNautix, TCS, Wipro,
implement NAND gate logic in C code without using any bitwise operatior.
Write a program to find the biggest number of three numbers in c?
why programming language C is still used in operating system's kernel??