#include "mystring.h" mystring::mystring( const char* str1 ) { cout << "Inside the constructor." << endl ; if ( str1 == NULL ) ptr = NULL ; else { int len = strlen( str1 ) + 1; ptr = new char[ len ] ; strcpy ( ptr, str1 ) ; } } mystring::~mystring() { cout << "Inside the destructor." << endl ; if ( ptr != NULL ) delete[] ptr ; } void mystring::print() { cout << ptr << endl ; }