#include #include // has EXIT_SUCCESS class SC { public: SC(void) { b = new bool; return; } ~SC(void) { delete [] b; return; } void set(const bool B) { *b = B; return; } bool get(void) const { return *b; } private: bool * b; }; int main(void) { SC obj1; obj1.set(true); SC obj2(obj1); obj1.set(false); if (obj1.get() == true) cout << "obj1 is true\n"; else cout << "obj1 is false\n"; if (obj2.get() == true) cout << "obj2 is true\n"; else cout << "obj2 is false\n"; return EXIT_SUCCESS; }