I will give some examples and explain. First, I declare some object like
CString* param = new CString[100]
And when I declare this one, my memory would increase a little bit because it's some implemented string. Then I store this object in some list of CString just like
List<CString> myList = new List<CString>; // new list of CString
myList.add(param);
This is my question: I wanna know, when I delete myList, my param isn't deleted, right? And memory in param still exists.
Do I misunderstand?
newis used differently in C++.List. Apparently it has a constructor that takes aList*, and when instantiated on a type, it traffics in pointers to that type. Quite an odd class...