Can anyone help me, why I\'m getting an error message while trying to free the allocated memory: Heap corruption detected. CTR detected the application wrote the memory after en
new char [strlen(s)]; does not count the closing \0 character, so your buffer is too short by one character.
new char [strlen(s)];
\0