share data among objects in a class

Let's say I have a class called myClass that will have a variable called commonData. Objects myOjectA and myOjectB are from myClass.

When I assign / update the value of commonData for myObjectA, all ojbects that have derived from myClass (myObjectB, etc.) will also have the same commonData value as myObjectA. Is it possible?

Make the commonData static:
static int commonData;
Last edited on
That was it. Appreciated!
Topic archived. No new replies allowed.