+ 15
Classes or Structures (structs)?
To query the difference(s) between classes and structures (structs)
3 Answers
+ 13
by default members in structure r public and in class r private.
rest same
+ 5
Classes and structures in C++ are essentialy the same expect from their default access levels which is private for classes and public for structs. In every other way I know of they have the same functionality.
- 3
In structure we can't use the access specifiers whereas in class we can.
In a class we can also declare a function but in structure we can't.
While declaration of variables of a struct we must specify it's a structure by using keyword struct whereas in class it is not necessary.