Runtime type identification (RTTI)
Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or […]
Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or […]
Container classes are the solution to a specific kind of code reuse problem. They are building blocks used to create
Following is the source code of simple queue implementation with the help of Inheritance and Polymorphism i.e. Late Binding.
In this post we are going to write C++ program to implement stack data structure using Templates in C++. Stack
This C++ program simulates the cache coherence problem graphically. In computer architecture, cache coherence is the uniformity of shared resource
This a database management project that demonstrate the database operations. The operations include add, edit and delete the records. User can also search the records.
This C++ Program demonstrate the use of pipes to pass a continuous stream of data between processes. It has four parts i.e. Simple named pipe client , Overlapped Server, Simple named pipe server and Advanced named pipe server.
This sample illustrates how to programmatically change an IP address for a specific network adapter on your machine. This program also demonstrates how to retrieve existing network adapter IP configuration information using Win32 APIs.
This is a Graphical calculator and graphical dairy which uses files to store the diary information. [code=’c’]/******************************************************* * MYCPLUS Sample
Example of a program with a little information?hiding contained in it.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
/******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. * * * * Please direct all inquiries to saqib at mycplus.com * *******************************************************/ #include <iostream.h> class one_datum { int data_store; public: void set(int in_value); int get_value(void); }; void one_datum::set(int in_value) { data_store = in_value; } int one_datum::get_value(void) { return data_store; } main() { one_datum dog1, dog2, dog3; int piggy; dog1.set(12); dog2.set(17); dog3.set(-13); piggy = 123; // dog1.data_store = 115; This is illegal in C++ // dog2.data_store = 211; This is illegal in C++ cout << "The value of dog1 is " << dog1.get_value() << "\n"; cout << "The value of dog2 is " << dog2.get_value() << "\n"; cout << "The value of dog3 is " << dog3.get_value() << "\n"; cout << "The value of piggy is " << piggy << "\n"; } // Result of execution // // The value of dog1 is 12 // The value of dog2 is 17 // The value of dog3 is -13 // The value of piggy is 123 |
Error recovery is a fundamental concern for every program you write, and it’s especially important in C++, in which one
The basic concept of multiple inheritance (MI) sounds simple enough: you create a new type by inheriting from more than