Wednesday, 23 January 2019

What are the differences between a C++ struct and C++ class

What are the differences between a C++ struct and C++ class?

Answer:

The default member and base class access specifiers are different. The C++ struct has all the features of the class.

The only differences are that a struct defaults to public member access and public base class inheritance, and a class defaults to the private access specifier and private base class inheritance.

No comments:

Post a Comment