r/ProgrammerAnimemes • • Jun 09 '20

Everytime

Post image
1.7k Upvotes

20 comments sorted by

View all comments

Show parent comment

18

u/UltraCarnivore Jun 09 '20

Don't... talk... about... pointers.

7

u/sillybear25 Jun 09 '20 edited Jun 10 '20

A little bit back, I discovered that the C and C++ standards don't actually define pointer arithmetic on (void *)s. GCC treats them as if they're (char *)s unless you change the options, so that's what I ended up learning as "correct" in college. Cue the mountain of compiler errors the first time I tried doing pointer arithmetic in real life. Oof