0

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.

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by daviddoria
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.