Rationale for difference in “default” access-specifier for a base class
问题 I know that there're few differences between struct and class in C++. I also understand the reason(s) for few of the difference(s). Like this one, Members of struct are public by default ; members of class are private by default . The reason why members of struct are public by default , is to make C++-struct compatible with C-struct . And the reason why member of class are private by default , is to introduce the concept of data encapsulation (i.e enforcing object-oriented principles