Click here to Skip to main content
15,891,789 members

Comments by Ross Peralta (Top 2 by date)

Ross Peralta 29-Nov-10 11:30am View    
Deleted
Enrique's answer is the best and true, undoubtedly. But Member still asked a valid question.

Yes, you'd have to free the string pointer before you lost the pointer to it. You could have also solved this via OOP. By having an object manage its dynamic memory in its constructor/deconstructor pair.

Then, since your object handled the memory management of the string array, you'd only have to delete the dynamically allocated array of objects without worrying about the memory that the objects themselves dynamically allocate.
Ross Peralta 19-Nov-10 17:28pm View    
Deleted
Can't agree more about the style. I hate the previous one.