Google News
logo
CPP - Interview Questions
What differences separate structure from a class in C++?
There are two important distinctions between a class and a structure in C++. These are :
 
* When deriving a structure from a class or some other structure, the default access specifier for the base class or structure is public. On the contrary, default access specifier is private when deriving a class.

* While the members of a structure are public by default, the members of a class are private by default
Advertisement