I have 3 classes, in which one of this is a data storage class (says, classData), another two are the classes (says, classA and classB) that need to perform read and write data to this data class.
My question is, how can I share the data of classData between classA and classB, i.e. if I perform some functions within classA that write some data into classData, how can I extract the same data written by classA from within classB?
I know this can be done through the global variables, but I am trying to avoid the globals variables that may lead to some unauthorised access problems.
====== ClassData.h =======
====== ClassA.h =======
====== ClassB.h =======