[Solved] Unable to alter a character in string literal Via pointer [duplicate]


You may not change a string literal that way.

https://stackoverflow.com/a/17507772/234307

“A C string literal creates an anonymous array of char. Any attempt to modify that array has undefined behavior.” – Keith Thompson

1

solved Unable to alter a character in string literal Via pointer [duplicate]