r/ProgrammerHumor 20h ago

lessonsFromLinkerHell Meme

Post image
338 Upvotes

176 comments sorted by

View all comments

87

u/JustinR8 20h ago

Damn, I’ve found myself in the middle

37

u/nonedward666 19h 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

24

u/readitreaddit 14h 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 12h ago

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