x = new object();
and use it within my class where the program works,
But there comes a certain point I need to use another class and continue to use my object 'x', thought of using Singleton, but in my case I can't.
class ClassX{public: ClassX(); ~ClassX();//...private: object* x;}
class ClassY{public: ClassY(); ~ClassY();//...private: // I can not create another object* x // I need to continue using the same object that was the classX}
I thought the classY create a parameter that receives the object, would work? ie everything that has been created within the object x in classX continue working?
something like:
class ClassY{public: ClassY(object *obj_x); ~ClassY();private://...}
please help-me :(