1.

How The Keyword Struct Is Different From The Keyword Class In C++?

Answer»

In C++, a class is similar to a STRUCT with the exception that, by default, all the MEMBERS of a class are private; while the members of a struct are public. Encapsulation is not supported by STRUCTURES but supported by classes.

In C++, a class is similar to a struct with the exception that, by default, all the members of a class are private; while the members of a struct are public. Encapsulation is not supported by structures but supported by classes.



Discussion

No Comment Found