#include<iostream.h> class Tab { int x, y; public: void show(void); void main(void); }; void Tab::show(void) { Tab b; b.x = 2; b.y = 4; cout<< x << " " << y; } void Tab::main(void) { Tab b; b.x = 6; b.y = 8; b.show(); } int main(int argc, char *argv[]) { Tab run; run.main(); return 0; }
#include<iostream.h> class CuriousTab { int x; float y; public: void CuriousTabFunction(int = 0, float = 0.00f, char = 'A'); void CuriousTabFunction(float, int = 10.00, char = 'Z'); void CuriousTabFunction(char, char, char); }; int main() { CuriousTab objCuriousTab; objCuriousTab.CuriousTabFunction(10 * 1.0, int(56.0)); return 0; } void CuriousTab::CuriousTabFunction(int xx, float yy, char zz) { x = xx + int(yy); cout<< "x = " << x << endl; } void CuriousTab::CuriousTabFunction(float xx, int yy, char zz) { x = zz + zz; y = xx + yy; cout<< " x = " << x << endl; } void CuriousTab::CuriousTabFunction(char xx, char yy, char zz) { x = xx + yy + zz; y = float(xx * 2); cout<< " x = " << x << endl; }
#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 Tab { int x, y; public: Tab(int x, int y) { this->x = x; this->y = y; } void Display() { cout<< x << " " << y; } }; int main() { int x = 50; int &y = x ; Tab b(y, x); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.