Classes and Structures are Related
#include <iostream> using namespace std; struct MyClass { int get_i(void); // these are public by default void put_i(int j); private: int i; } ; int MyClass::get_i(void) { return i; } void MyClass::put_i(int j) { i = j; } main(void) { MyClass s; s.put_i(10); cout << s.get_i(); return 0; }