Structures and Classes
Mertovun (10)Jan 6, 2009 at 10:17am UTC
Hi. I don't understand what the difference between structures and classes. Can anybody explain it, please? Thanks.
jsmith (958)Jan 6, 2009 at 10:17am UTC
Default access in a struct is public and in a class is private. Otherwise they are absolutely identical from a compiler standpoint.
Umz (153)Jan 6, 2009 at 10:17am UTC
Can a structure have member functions? I thought that there were collosal differences such as inheritance and the likes, that what I got told.
jsmith (958)Jan 6, 2009 at 10:17am UTC
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.
Umz (153)Jan 6, 2009 at 10:17am UTC
Great! Its good that the standards get updated, so if there basicallly the same thing now which one is better to use?
helios (1520)Jan 6, 2009 at 10:17am UTC
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 Jan 6, 2009 at 10:17am UTC
This topic is archived - New replies not allowed.