--- Comment #2 from hxdg21 at yahoo dot com 2009-09-30 03:09 ---
Thank you for the clarification. My friend and I ran across this while
comparing the assembly generated by different compilers/platforms when
manipulating strings. A largely academic exercise. That piece of code did not
loo
--- Comment #1 from paolo dot carlini at oracle dot com 2009-09-09 13:28
---
Your code is clearly invalid: str points to "test", but that memory itself is
read-only, roughly speaking. More correctly, the Standard says that the effect
of attempting to modify a string literal is undefined