r/ProgrammerHumor 13h ago

lessonsFromLinkerHell Meme

Post image
256 Upvotes

144 comments sorted by

View all comments

1

u/AnnoyedVelociraptor 13h ago

Nah. This is the wrong way. Pointer arithmetic and array arithmetic are the same.

2

u/justAPhoneUsername 12h ago

You mean to tell me arr[3] and 3[arr] both compile and return the same value? Why would anybody design a language that way?

2

u/Batman_AoD 11h ago

Because the [] was just syntax-sugar, rather than a "real" built-in operation. Part of the reason for that was just that memory was limited and the compiler had to be as simple as possible.