Tuesday, 24 February 2015

Pure Virtual Function Program in C++

#include<iostream.h>

class PureVirtual
{
public:
virtual void PDemo()=0;
virtual void NDemo(){};
};
class PureDef:public PureVirtual
{
public:
void PDemo()
{
cout<<"\n Pure Virtual Demo";
}
void NDemo()
{
cout<<"\n Null Virtual Demo";
}
};
void main()
{
PureDef PD;
PD.PDemo();
PD.NDemo();
}

No comments:

Post a Comment