Structures and Classes

Hi. I don't understand what the difference between structures and classes. Can anybody explain it, please? Thanks.
Default access in a struct is public and in a class is private.
Otherwise they are absolutely identical from a compiler standpoint.
Can a structure have member functions?
I thought that there were collosal differences such as inheritance and the likes, that what I got told.
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.
Great! Its good that the standards get updated, so if there basicallly the same thing now which one is better to use?
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
Topic archived. No new replies allowed.