Home » C++ Programming » Objects and Classes

What will be the output of the following program? #include class Tab { public: int x; }; int main() { Tab *p = new Tab(); (*p).x = 10; cout<< (*p).x << " " << p->x << " " ; p->x = 20; cout<< (*p).x << " " << p->x ; return 0; }

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!