V
Verbal Kint
hi everyone.
i am having a problem with the this-pointer in the code below. for the
command: "MyFunctB(this)"; i am getting the following error:
error C2664: 'cTest::MyFunctB' : cannot convert parameter 1 from 'cTest
*const ' to 'cTest'
whats the problem?
thanks.
V.K.
CODE:
class cTest
{
public:
cTest()
{
for (int i=0;i<3;i++)
dat = rand()%43;
}
void MyFunctA ()
{
MyFunctB(this);
}
void MyFunctB (cTest a)
{
}
private:
int dat[3];
};
int main()
{
int i=0;
srand(time(0));
cTest A;
A.MyFunctA();
_getch();
return 0;
}
i am having a problem with the this-pointer in the code below. for the
command: "MyFunctB(this)"; i am getting the following error:
error C2664: 'cTest::MyFunctB' : cannot convert parameter 1 from 'cTest
*const ' to 'cTest'
whats the problem?
thanks.
V.K.
CODE:
class cTest
{
public:
cTest()
{
for (int i=0;i<3;i++)
dat = rand()%43;
}
void MyFunctA ()
{
MyFunctB(this);
}
void MyFunctB (cTest a)
{
}
private:
int dat[3];
};
int main()
{
int i=0;
srand(time(0));
cTest A;
A.MyFunctA();
_getch();
return 0;
}