0

This just occurred to me while writing a struct for my project, instead of a class:

With just one significant difference between structs and classes as mentioned here, what was the main reason to include the 'class' keyword in c++?

Has it been included for its comparativeness to other major object-oriented languages, Java for e.g.?

Community
  • 1
  • 1
Sankalp
  • 2,796
  • 3
  • 30
  • 43

1 Answers1

0

If you're interested on how C++ got the way it is until about '95, read The Design and Evolution of C++. The keyword was added quite early, when more plans were open. LAter the difference stayed as it is today.

Balog Pal
  • 16,195
  • 2
  • 23
  • 37