Computer Programming
C++ Programming
The Difference Between

Difference between structures and class?

User Avatar
Wiki User
May 22, 2012 1:31AM

Structure members are public by default while class members are private by default. Classes encapsulate the data and the methods that operate upon that data into a discrete package (an object), exposing only as much or as little interface as is required by the class itself, to ensure the data remains in a valid state at all times. Structures have no such protection.