I have a public/private variable (var) in class X, which I need to access from class Y.
The constraints are that class X is instantiated only once from the application. It cannot be instantiated in class Y again.
and
the variable (var) cannot be made static, as 2 different applications instantiating this class X should see the variable differently.
and cannot make the class Y nested in class X, also in class Y the func() arguments cannot be added, because this function is being called from somewhere in the state machine which passes on only 2 arguments.

class X
{
public:
int a;
};

class Y
{
static func(int aa, int bb)
{
a = 1; //want to perform the set/get operations from this class for 'a'...
}

};

require experts help in solving this,
thanks in advance.