August 5th, 2013, 12:42 PM
In c++ how we can apply destructor?
Tell me fast?
March 27th, 2014, 06:32 AM
The process of creating and deleting objects in C++ is not a trivial task. Every time an instance of a class is created the constructor method is called. The constructor has the same name as the class and it doesn't return any type, while the destructor's name it's defined in the same way, but with a '~' in front:
String() //constructor with no arguments
String(int size) //constructor with one argument
str = new char[size];
delete  str;
get more information from here cprogramming.com