Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2.  
  3. class ExampleClass
  4. {
  5. const public: // A section that allows everyone to read. Only the class itself may write.
  6.     int iterator;
  7. public:
  8.     ExampleClass( void ) : iterator(0) {}
  9.     void Increment( void ) { ++iterator; } // Write: allowed within class.
  10. };
  11.  
  12. int main(int, char**)
  13. {
  14.     ExampleClass example;
  15.     example.Increment();
  16.     std::cout << example.iterator << std::endl; // Read: Allowed everywhere.
  17.     return 0;
  18. }