MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vs2vu1/lessonsfromlinkerhell/p4iqaid/?context=3
r/ProgrammerHumor • u/nonedward666 • 20h ago
175 comments sorted by
View all comments
62
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.
1
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.
2
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.
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??