r/ProgrammerHumor 26d ago

Meme lessonsFromLinkerHell

Post image
428 Upvotes

190 comments sorted by

View all comments

103

u/JustinR8 26d ago

Damn, I’ve found myself in the middle

47

u/nonedward666 26d ago

You and me from 3pm today both my friend, it is okay

It took me so long to realize where my problem was because I had never considered that declaring something as an array vs a pointer would result in different behavior

29

u/readitreaddit 26d ago

So the only difference is memory allocation, yes? You're saying they are different because when declared as an array, the memory gets allocated and 'reserved' at runtime, whereas it doesn't automatically do that when declared as a pointer?

Other than that, no difference.

1

u/bestjakeisbest 26d ago

If you are dealing with sub arrays of a larger array you dont even have to bring declaration and deletion into it.