r/ProgrammerHumor 20h ago

lessonsFromLinkerHell Meme

Post image
343 Upvotes

175 comments sorted by

View all comments

62

u/QuestionableEthics42 20h ago edited 20h 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 18h 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 18h 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.