#include<iostream> enum curioustab { a=1, b, c }; int main() { int x = c; int &y = x; int &z = x; y = b; std::cout<< z--; return 0; }
#include<iostream.h> class CuriousTabBase { public: int x, y; CuriousTabBase(int xx = 0, int yy = 5) { x = ++xx; y = --yy; } void Display() { cout<< --y; } ~CuriousTabBase(){} }; class CuriousTabDerived : public CuriousTabBase { public: void Increment() { y++; } void Display() { cout<< --y; } }; int main() { CuriousTabDerived objCuriousTab; objCuriousTab.Increment(); objCuriousTab.Display(); return 0; }
#include<iostream.h> class CuriousTab { int x; public: CuriousTab(short ss) { cout<< "Short" << endl; } CuriousTab(int xx) { cout<< "Int" << endl; } CuriousTab(float ff) { cout<< "Float" << endl; } ~CuriousTab() { cout<< "Final"; } }; int main() { CuriousTab *ptr = new CuriousTab('B'); return 0; }
#include<iostream.h> class CuriousTabArray { int Matrix[3][3]; public: CuriousTabArray() { for(int i = 0; i<3; i++) for(int j = 0; j < 3; j++) Matrix[j][i] = i + j; } void Display(void) { for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) cout<< Matrix[j][i] << " "; } }; int main() { CuriousTabArray objCuriousTab; objCuriousTab.Display(); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.