Sezar, remember, your logic will work for sure. But careful, as Fardad mentioned, It is not safe to use return funtion in the middle of the coding. By this way, your function will terminate without doing deleting the dynamic string at the end. So it's better to use return at the end of the function only.
sorry man, i saw your comment and changed the language...and thanks your feedback, im fixing it, tell you if it works later.
ReplyDeleteSezar, remember, your logic will work for sure. But careful, as Fardad mentioned, It is not safe to use return funtion in the middle of the coding. By this way, your function will terminate without doing deleting the dynamic string at the end. So it's better to use return at the end of the function only.
ReplyDeletetrue is you have allocated a new memory then just do this :
Deleteif( IsTextEditor)
{
delete [] str;
return 0;
}