#include<iostream.h> class Tab { int x; public: Tab(); ~Tab(); void Show() const; }; Tab::Tab() { x = 25; } void Tab::Show() const { cout<< x; } int main() { Tab objB; objB.Show(); return 0; }
class Birds {}; class Peacock : protected Birds {};
#include<iostream.h> int main() { int x = 80; int &y = x; x++; cout << x << " " << --y; return 0; }
#include<iostream.h> class A { public: void CuriousTabFunction(void) { cout<< "Class A" << endl; } }; class B: public A { public: void CuriousTabFunction(void) { cout<< "Class B" << endl; } }; class C : public B { public: void CuriousTabFunction(void) { cout<< "Class C" << endl; } }; int main() { A *ptr; B objB; ptr = &objB; ptr = new C(); ptr->CuriousTabFunction(); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.