1C++ is a high-level, general-purpose programming language.
2
3//totally not right there ----------------------------------->
1#include <iostream>
2using namespace std;
3class BaseClass {
4public:
5 void disp(){
6 cout<<"Function of Parent Class";
7 }
8};
9class DerivedClass: public BaseClass{
10public:
11 void disp() {
12 cout<<"Function of Child Class";
13 }
14};
15int main() {
16 /* Reference of base class pointing to
17 * the object of child class.
18 */
19 BaseClass obj = DerivedClass();
20 obj.disp();
21 return 0;
22}
1 C++ language is a direct descendant of C programming language with
2additional features such as type checking, object oriented programming,
3exception handling etc. It was developed by Bjarne Stroustrup.