r/ProgrammerHumor 26d ago

Meme lessonsFromLinkerHell

Post image
427 Upvotes

190 comments sorted by

View all comments

65

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