As you were told, write a file. A file is formatted data stored on the hard disk, so it is permanent allocation in that sense.
Yes. But many destructors do more than simply release memory, so make sure that they are called with delete if you use new. Any additional steps a destructor takes would not be automatically performed by the OS in a memory-leak kind of situation.All I have is, only one confusion.!!! If i didn't use 'delete' OS itself will clean the allocated memory.