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


Please Help Members By Posting Answers For Below Questions

How to declare a variable?

568


Are c and c++ the same?

627


What does d mean?

581


What is pragma c?

609


What does != Mean in c?

584






What's a good way to check for "close enough" floating-point equality?

623


What does the c in ctime mean?

566


What is volatile variable in c with example?

584


Is void a keyword in c?

574


How do you define a function?

581


How many identifiers are there in c?

578


What is the stack in c?

714


What is I ++ in c programming?

623


What are the parts of c program?

633


I need previous papers of CSC.......plz help out by posting them.......

1816