I was wondering about this:
In Java (which is the OO programming language I am used to), this would cause both variables to point to the same object in memory, and cause obj2 to be garbage collected.Code:MyObject obj1; MyObject obj2; obj1 = obj2;
A don't know if in C++ it will do what Java does or make obj2 an independent duplicate of obj1? And if so, how do you make two variables point to the same object?