对不起,如果这是一个微不足道的问题:
实施1:
class Foo
{
protected: int bar;
public: Foo(int bar)
{
this->bar =bar;
}
};
实施2:
class Foo
{
protected: int bar;
public: Foo(int bar)
{
this.bar =bar;
}
};
实施 2 的输出:
request for member ‘x’ in ‘this’, which is of pointer type ‘Foo* const’ (maybe you meant to use ‘->’ ?)
this
指针也是,这个问题在代码中有语法错误