I have written a sample code,
class A
{
public:
void func1(X *ptr);
};
class B
{
public:
void func2(X **ptr);
};
void A::funct1(X *ptr)
{
//some code here
}
void B::funct2(X **ptr)
{
//some code here
X *ptr;
*ptr->func1(*ptr);
}
main()
{
B Bobj;
X **ptr;
Bobj.funct2(**ptr);
return 0;
}
and i am getting the following lines while i compile the above code in LINUX environment,
In member function âvoid B::func2(X**)â:
error: request for member âfunc1â in â* ptrâ, which is of non-class type âX*â
In function âint main()â:
error: no matching function for call to âB::func2(X&)â
note: candidates are: void B::func2(X**)
How to resolve/correct my code?
Please help!!
Thanks in advance.