The function is not a pointer, but returns char*.
The function changes the line.
This method is XORused to replace two elements without additional memory. As you can see, the loop repeats through the beginning and end of the line and swaps the two chars.
source
share