[ create a new paste ] login | about

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

C++, pasted on Aug 19:
class Base
{
   public:
     virtual void fun() = 0;
    /* {
         cout<<"Base virtual fun"<<endl;
     }*/
};
class Derived : public Base
{
    public:
    void fun()
    {
       cout<<"Derived virtual fun"<<endl;
    }
};
int main()
{
   Derived d;
   d.fun();
   return 0;
}


Output:
1
Derived virtual fun


Create a new paste based on this one


Comments: