Home » C++ Programming » Objects and Classes

What will be the output of the following program? #include class CuriousTabTeam { int x, y; public: CuriousTabTeam(int xx) { x = ++xx; } void Display() { cout<< --x << " "; } }; int main() { CuriousTabTeam objBT(45); objBT.Display(); int *p = (int*)&objBT; *p = 23; objBT.Display(); return 0; }

Correct Answer: 45 22

← Previous Question Next Question→

More Questions from Objects and Classes

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion