I have a function something like:
MyClass1 mc1, mc0; //Single Object
MyClass2 mc2; //vector of MyClass1
mc1.Init(1);
mc2.Add(mc1);
mc1 = mc0;
mc1.Init(2);
mc2.Add(mc1);
mc1 = mc0;
//so on......
I actually want to set mc1 = null
before at the beginning of the step but cannot do that in C++. So I kept a never-initialized mc0
to do that.
Don't think this is an elegant solution.
My background was mainly about C# and ASP.NET which is managed.(I think the unmanaged
attribute of C++ is the reason why I cannot do object = null. Right?)