[Solved] Overloading * operator for string in C++ [closed]


The problem is because you are not allocating new memory in operator*

strcpy and strcat assume that char array is large enough to contain the resulting string.

You should allocate enough memory so it is done in constructors.

2

solved Overloading * operator for string in C++ [closed]