i am writing a function in which based on some condition i am supposed to call another function with this passed as a parameter to it..
my code is somewhat like this..
Code:
class b
{
public:
b& func1(b &,b &);
b& func2(b &);
};
b& b :: func1(b &x,b &y)
{
z = new b();
.
.
return z;
}
b& b :: func2(b &x)
{
z = new b();
if(condition)
{
//if i use this --no matching function call to 'b::func1(b* const,b&)'
z = func1(this,x);
//if i use this --cannot convert 'b' to 'b*' in assignment
z = func1(*this,x);
}
else
{
z = x;
}
return z;
}
please help me...