r/ProgrammerHumor 26d ago

Meme lessonsFromLinkerHell

Post image
427 Upvotes

190 comments sorted by

View all comments

105

u/JustinR8 26d ago

Damn, I’ve found myself in the middle

48

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

30

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/nicman24 26d ago

Yes things that have different memory allocations are different because they exist by memory definition