Running this program shows error Debug assertion has failed. Expression BLOCK_TYPE_IS_VALID. why is it happening and how to fix it? please check the destructor it is happening if i change this.
Please correct me if i am wrong. if i make CustomString::operator+() to return by pointer or reference copy constructor will not be involved. so i only need to take care only of assignment operator.
if i make CustomString::operator+() to return by pointer or reference copy constructor will not be involved. so i only need to take care only of assignment operator.
If you make CustomString::operator+ return by pointer or reference, what will it be pointing or referring to? One of the objects fed to operator+ that should not be changed? A local-to-operator+ variable that will cease existing when the function returns?
In the main you've supplied there is no use of the assignment operator.