Structures and Classes

Sep 12, 2008 at 8:16am
Hi. I don't understand what the difference between structures and classes. Can anybody explain it, please? Thanks.
Sep 12, 2008 at 11:43am
Default access in a struct is public and in a class is private.
Otherwise they are absolutely identical from a compiler standpoint.
Sep 12, 2008 at 2:20pm
Can a structure have member functions?
I thought that there were collosal differences such as inheritance and the likes, that what I got told.
Sep 12, 2008 at 2:28pm
A long time ago there were differences. In the current standard there is no difference except for what I originally mentioned. Structs can have constructors, destructors, member functions, virtual functions and use inheritance just like classes.
Sep 12, 2008 at 3:06pm
Great! Its good that the standards get updated, so if there basicallly the same thing now which one is better to use?
Sep 12, 2008 at 3:15pm
Default access in a struct is public and in a class is private.
Otherwise they are absolutely identical from a compiler standpoint.
Last edited on Sep 12, 2008 at 3:15pm
Topic archived. No new replies allowed.