CPP coding code example
Example 1: Simple cpp code
#include<iostream>
using namespace std;
int main()
{
cout << " hello world <<endl;
return 0;
}
Example 2: c++ code
#include <iostrea>
Example 3: cpp language explained
#include <iostream>
using namespace std;
class BaseClass {
public:
void disp(){
cout<<"Function of Parent Class";
}
};
class DerivedClass: public BaseClass{
public:
void disp() {
cout<<"Function of Child Class";
}
};
int main() {
BaseClass obj = DerivedClass();
obj.disp();
return 0;
}