Hi again!
Can you open up a new thread for this unrelated question and maybe try to give an SSCCE? Check-out
http://sscce.org/ on how and why you should do this.
I for one do not understand what you're trying to do from your description alone. As to my confusion, notice how you mix up terms like:
- the definition of a class which is usually the source code of said class
- dynamic memory (allocated using the keyword new) and the concept of passing an object by-reference vs. by-value (passing an object / pointer(?) 'as a reference')
- dynamic memory and variable scope (dynamic memory lasts until you delete the object / array occupying said piece of memory where every variable is said to have a block-scope)
a class running out of scope (again the class is the definition, an object is an instance of a class, and a variable (related to the object) may run out-of-scope - class != object != variable)
I tried giving you some keywords if you want to delve into some tutorials learning these concepts (which I strongly recommend).
Best,
BeyelerStudios