Share this post

Link to post

Share on other sites

The ways posted will work, but if an exception is thrown in your program between the time the array is constructed and destructed the memory will not be freed unless you add some major ''try'' - ''catch'' blocks. A way around this is to use the STL and maybe do something of the following: