#include<iostream.h> class CuriousTab { int x; public: CuriousTab() { x = 0; } CuriousTab(int xx) { x = xx; } CuriousTab(CuriousTab &objB) { x = objB.x; } void Display() { cout<< x << " "; } }; int main() { CuriousTab objA(25); CuriousTab objB(objA); CuriousTab objC = objA; objA.Display(); objB.Display(); objC.Display(); return 0; }
#include<iostream.h> class CuriousTab { int x; public: CuriousTab(int xx, float yy) { cout<< char(yy); } }; int main() { CuriousTab *p = new CuriousTab(35, 99.50f); 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; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.