what is the difference between structure and union?
Answers were Sorted based on User's Feedback
Answer / karthikeyan
union is unified memory where structure is non unified memory.
all members of structure occupy consecutive chunks of
memory.but union members will share the most highest memory
of the union member.i.e data type.
we can access all the members of structure at a time.
but in union we can access a single union member at a time.
regards,
karthikeyan,
TRIOZTECH
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / dasari chaithanya
The difference between structure and union is ,structure
will occupie total number of bytes or memory sometimes
waste memory,but union is which is the higest memory than
the data will store the memory location.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sevak.yatrik777
While structure enables us treat a number of different
variables stored at different in memory , a union enables us
to treat the same space in memory as a number of different
variables. That is a Union offers a way for a section of
memory to be treated as a variable of one type on one
occasion and as a different variable of a different type on
another occasion.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do I convert a string to all upper or lower case?
What is macro?
How to removing white spces in c programming only bu using loops
What is the usage of the pointer in c?
Explain About fork()?
Explain what standard functions are available to manipulate strings?
int i=~0; uint j=(uint)i; j++; printf(“%d”,j);
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
where can function pointers be used?
What is the difference between exit() and _exit() function?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above