What is the difference between structure and enum?.

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
sam topper.
Messages
14
Reaction score
0
or else what is the difference between structure,union and enum.
can anyone please provide the exact information about them.
 
Last edited by a moderator:
Physics news on Phys.org
sam topper. said:
or else what is the difference between structure,union and enum.
can anyone please provide the exact information about them.

What research have you done on your own? What do you know about them so far? Definitions are not hard to find.
 
Last edited by a moderator:
structures allocate separate memory for all the fields specified
unions allocate memory equal to the largest datatype specified and all the fields reference the same space.
enums are just aliases for integers that are more organized and convenient than using #DEFINE
 
  • Like
Likes   Reactions: 1 person