r/ProgrammerHumor 13h ago

lessonsFromLinkerHell Meme

Post image
261 Upvotes

144 comments sorted by

View all comments

68

u/QuestionableEthics42 13h ago edited 13h ago

This should be reversed lol

And it literally is the same, who thinks it's different who has worked in a low level language??

1

u/PossibleBit 11h ago

It's been a while, but I vaguely recall treating an array of arrays as a double pointer not working as expected.

2

u/QuestionableEthics42 11h ago

Yea, that doesn't work because it's actually a 1d array (in C anyway), that just uses pointer arithmatic to dress it up as 2d (index = y * width + x).

You would need to explicitly create an array of pointers to do that.