Thursday, 19 September 2013

C++ Delete a pointer using delete []?

C++ Delete a pointer using delete []?

Here is the sample code piece in C++:
Foo *ptr;
ptr = new Foo;
delete [] ptr;
Could this run into problem? What should be the correct way to delete such
a pointer and free the memory?
Thank you

No comments:

Post a Comment