Hi i am getting undefined reference error in the following code:
class Helloworld{
public:
static int x;
void foo();
};
void Helloworld::foo(){
Helloworld::x = 10;
};
I don't want a static
foo()
function. How can I access static
variable of a class in non-static
method of a class?