[ create a new paste ] login | about

Link: http://codepad.org/AUP5tnGx    [ raw code | fork ]

C++, pasted on Jun 21:
//#include <bits/stdc++.h>
#include <iostream>
using namespace std;

//Base class
class Parent
{
    public:
      int id_p;
};
 
// Sub class inheriting from Base Class(Parent)
class Child : public Parent
{
    public:
      int id_c;
};

//main function
int main() 
   {
     
        Child obj1;
        Parent obj2;
        Child *pChild = &obj1;
        
        
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: