#include<iostream.h> class CuriousTab { int x, y; public: CuriousTab() { x = 0; y = 0; } CuriousTab(int xx, int yy) { x = xx; y = yy; } CuriousTab(CuriousTab *objB) { x = objB->x; y = objB->y; } void Display() { cout<< x << " " << y; } }; int main() { CuriousTab objCuriousTab( new CuriousTab(20, 40) ); objCuriousTab.Display(); return 0; }
#include<iostream.h> 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; }
#include<iostream.h> class CuriousTab { int x, y; public: CuriousTab(int xx = 10, int yy = 20 ) { x = xx; y = yy; } void Display() { cout<< x << " " << y << endl; } ~CuriousTab() { } }; int main() { CuriousTab objCuriousTab; objCuriousTab.Display(); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.