Program of Virtual function

/*Program of Virtual function*/

#include
#include
class A
{
int a,b;
public:
void getdata(int p,int q)
{
a=p;
b=q;
cout<<"\na="<getdata(2,4);
ptr->display();
getch();
return 0;
}

OUTPUT

a=2
b=4
CLASS B







Leave a Reply

Your email address will not be published. Required fields are marked *