3

Possible Duplicate:
What are the differences between struct and class in C++
C++ - struct vs. class

How are structures different from objects and classes in C++? Is there any performance benefit to using objects or structures?

Community
  • 1
  • 1
Reid
  • 4,376
  • 11
  • 43
  • 75

2 Answers2

10

Structures and classes are identical; the language standard uses the term "class" to refer to both. The only difference between defining a class using the struct or the class keyword is the default accessibility of members and base classes; there is no difference in their runtime behaviour or performance.

An "object" is a run-time instance of a type. In C++, the term is used for instances of any type, including classes and fundamental types.

Mike Seymour
  • 249,747
  • 28
  • 448
  • 644
0

main thing is by default variables are private in a class and by default they are public in structures. also you can google this and find a million and one topics on this. for example http://blog.stevedoria.net/20050913/differences-between-cpp-classes-and-structs

Shredder2500
  • 1,065
  • 2
  • 11
  • 26