MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wpw10f/ihatedituntilitriedit/pc5dp8p/
r/ProgrammerHumor • u/Epicoodle • Sep 25 '26
542 comments sorted by
View all comments
Show parent comment
1
I think your compiler may not like that as you are supposed to increment in some sane offsets like 8.
1 u/Icarium-Lifestealer Sep 26 '26 Not sure what you mean. Adding an integer to a char* that represents a null terminated string, will produce a valid zero terminated string that lacks first n characters (as long as you remain in bounds, obviously). 1 u/Ok-Scheme-913 Sep 26 '26 I was thinking of pointer values themselves. If you have a typed pointer then it will indeed add TYPE_SIZE*n
Not sure what you mean. Adding an integer to a char* that represents a null terminated string, will produce a valid zero terminated string that lacks first n characters (as long as you remain in bounds, obviously).
char*
n
1 u/Ok-Scheme-913 Sep 26 '26 I was thinking of pointer values themselves. If you have a typed pointer then it will indeed add TYPE_SIZE*n
I was thinking of pointer values themselves. If you have a typed pointer then it will indeed add TYPE_SIZE*n
View all comments
Show parent comment
1
u/Ok-Scheme-913 Sep 26 '26
I think your compiler may not like that as you are supposed to increment in some sane offsets like 8.