"sunnewton" <su************@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi,All,
A simple question:
How to share a variable between two classes? I mean hte variablein one
class updated then in the other it will update, too.
Thanks in advance:)
Depends on what you actually are trying to achieve. One way is to pass a
pointer/reference to the variable into one of the classes.
But, is yoru question about sharing a variable between two classes, or
between 2 instances of 2 different classes?
It comes down to: what are you trying to achieve? There are many ways, and
it depends on what you're trying to do.