Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What is the difference between structure and enum?.

  1. Aug 7, 2013 #1
    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: Aug 7, 2013
  2. jcsd
  3. Aug 7, 2013 #2


    User Avatar
    Gold Member

    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: Aug 7, 2013
  4. Aug 8, 2013 #3


    User Avatar
    Gold Member

    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
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook