What is the difference between struct and union in C?
Answer Posted / hrpynux@gmail.com
A struct is a block of memory that stores several data objects, where those objects don't overlap. A union is a block of memory that stores several data objects, but has only storage for the largest of these, and thus can only store one of the data objects at any one time.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is the benefit of using an enum rather than a #define constant?
Why static is used in c?
What is the use of function in c?
Why do we use int main instead of void main in c?
Where are c variables stored in memory?
What is masking?
Explain data types & how many data types supported by c?
What is an array in c?
What is calloc() function?
What’s a signal? Explain what do I use signals for?
What are c header files?
How can I handle floating-point exceptions gracefully?
How can I list all of the predefined identifiers?
How can I get random integers in a certain range?