Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A
- {
- protected:
- int x;
- public:
- A(int x = 5) : x(x + 1)
- {
- cout << "In A::A x=" << x << endl;
- }
- operator int() const { return x; }
- };
- void main()
- {
- A a1(10);
- cout << a1 << endl ;
- }
- In A:: An x=11
- 11
- In A:: An x=10
- 11
Add Comment
Please, Sign In to add comment