My program was:-
#include < iostream.h>
#include < conio.h>
struct base
{
protected:
void get()
{
cin>>a>>b;
}
public:
base(int i=0, int j=0);
void put()
{
cout << a << '\t' << b << "\tput 1";
}
int a,b,c;
~base()
{
cout << "base destroyed";
}
};
class deri : protected base
{
int c,d;
char w;
int ans;
public:
deri(int r=7, int s=0)
: base(r,s)
{
c=r;
d=s;
cout << "\nDerived invoked\n";
}
void put()
{
cout << c << '\t' << d << '\t' << a << '\t' << b;
}
};
class d2 : protected deri
{
public:
d2() {}
void start();
void add()
{
get(); // ERROR HERE: Implicit conversion of 'd2 *' to 'base *' not allowed
}
~d2(){}
};
void d2::start()
{
put();
}
base::base(int i, int j)
{
a=i;
b=j;
cout << "\nbase invoked\n";
cout << "Enter a,b: ";
get();
}
void main()
{
clrscr();
getch();
}
CAN anyone explain what the error msg means?