In x86-64 GCC, is the following C snippet valid? char *p = "HELLO WORD"; *p+++=0x20; *p+++=0x20; *p+++=0x20; *p+++=0x20; *p+++=0x20; puts(p-5);
-
Show this thread
-
How about this one? char *p = (char *){"HELLO WORD"}; *p+++=0x20; *p+++=0x20; *p+++=0x20; *p+++=0x20; *p+++=0x20; puts(p-5);
2 replies 0 retweets 3 likesShow this thread -
Replying to @rep_stosq_void
*is* there a way to get a writable string using the string literal syntax, without some sort of explicit copy operation? I feel like I should know this
5 replies 0 retweets 4 likes
Replying to @johnregehr
Just declare with p[] instead of *p.
8:32 AM - 21 Apr 2019
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.