Possible Duplicate:
C++ equivalent to Java this
What is the c++ version of java's this. :
class javaObj{
private String name;
public void setName(String name)
{
this.name = name;
}
}
Only thing i have found that works in c++ is:
class cppObj
{
private:
string name;
public:
void setName(string name);
};
void cppObj::setName(string name)
{
cppObj::name = name;
}
must I use cppObj:: or is there a this. equivalent for c++?