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
You need to specify char *s1 = new char [strlen(s) + 1]; to make room for the '\0' which terminates the string.
char *s1 = new char [strlen(s) + 1];
'\0'