I have a class defined like this:
class MyClass
{
int x;
public:
MyClass(int x);
};
MyClass::MyClass(int x)
{ //Assign x here
}
However, I can't initialize x
in the constructor because it has the same name as an instance variable. Is there any way around this(other than changing the name of the argument)?