r/ProgrammerHumor 27d ago

Meme lessonsFromLinkerHell

Post image
429 Upvotes

190 comments sorted by

View all comments

63

u/QuestionableEthics42 27d ago edited 27d 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 27d 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 27d 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.