N
Nobody You Know
I need a member variable in class A known within an instance of class
B, even though B does not instantiate A.
My solution was to make the member variable private static, and create
a public static accessor function that returns the variable's value. I
reference this function in class B as ClassA::GetValueOfVariable().
Although this works, I wonder if there is a better way.
B, even though B does not instantiate A.
My solution was to make the member variable private static, and create
a public static accessor function that returns the variable's value. I
reference this function in class B as ClassA::GetValueOfVariable().
Although this works, I wonder if there is a better way.