Hi Guys,
I have general C++ question. When I am using dynamic arrays is it a good idea to just create the array with "new int[1]" for example in Constructor and then resize it where its actually being used? This will make it completely easy as then I will just do "delete []" on it in Destructor. The reason I am asking is I have a class where certain functions return a dynamic array and I will have to remember to do delete [] on them. If I go this path (new in Ctor) then these array will always be deallocated when I destroy my object. Are there any better approaches to this issue?
Thanks in advance
-sam