cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Beginners : Structures and Classes
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programm...
Articles
Lounge
Jobs

-

post  Structures and Classes

Mertovun (10)
Hi. I don't understand what the difference between structures and classes. Can anybody explain it, please? Thanks.
|
jsmith (958)
Default access in a struct is public and in a class is private.
Otherwise they are absolutely identical from a compiler standpoint.
|
Umz (153)
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)
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)
Great! Its good that the standards get updated, so if there basicallly the same thing now which one is better to use?
|
helios (1520)
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

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2009 - All rights reserved - v2.2
Spotted an error? contact us