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
What is malloc and calloc?
How do you sort filenames in a directory?
What are void pointers in c?
What is data types?
How can I ensure that integer arithmetic doesnt overflow?
What is a lvalue
What are the disadvantages of a shell structure?
Can a local variable be volatile in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Why is it that not all header files are declared in every C program?
what are the 10 different models of writing an addition program in C language?
can we have joblib in a proc ?
What are header files and what are its uses in C programming?
Explain what is wrong in this statement?
How are variables declared in c?