|
There is no class name, and the x used in the function is not specified, of course it is wrong
Most likely you want to use the x in the class, I understand so
Should be like this /
#include <iostream.h>
class classname / * Give a class name * / {
private:
static int x;
};
int classname :: x; // outside the class defines the static variables of the class, what is inside the class is just a declaration
void fun (ing a)
{x = a;}
that's it!!! |
|