Help with a c++ const variable# Programming - 葵花宝典
lz
1 楼
I define the following class A
class A
{
A(const A& a)
{
int size=a.getsize();// line4
}
public:
int getsize();
}
I get the following error in line 4
"can not convert 'this' pointer from const A to A& "
Can you guys tell me the reason?
Thanks!
class A
{
A(const A& a)
{
int size=a.getsize();// line4
}
public:
int getsize();
}
I get the following error in line 4
"can not convert 'this' pointer from const A to A& "
Can you guys tell me the reason?
Thanks!