i understand that i can't use a varname outside the functions\class's with '::' operator
Make the variable static and you can use it outside the class with :: opertor.
class MyClass
{
public:
static int x;
};
int MyClass::x = 0; // static variables must also be declared like globals
int main()
{
MyClass::x = 1;
}