#include using namespace std; #include "A.h" int main() { // Value of n cannot be changed. const int n = 7; cout << n << endl; // x data member is const. A a(2, 3); // Whole class is const. const A b(4, 5); cout << a.x << " " << a.y << endl; cout << b.x << " " << b.y << endl; // x data member cannot be changed. a.y = 13; cout << a.x << " " << a.y << endl; // The following line is not legal // because b is const. // b.y = 15; return EXIT_SUCCESS; } // Output: // 7 // 2 3 // 4 5 // 2 13