r/ProgrammerHumor 2d ago

Meme bugIntroducedDebugging

Post image
1.1k Upvotes

120 comments sorted by

View all comments

346

u/AdBrave2400 2d ago

Is the mistake that they're allocating 1 byte and storing in a pointer to an int which is 4 bytes?

1

u/bloody-albatross 2d ago edited 2d ago

You're still on 32 bit? Are you doing a lot of embedded stuff?

Edit: I misread and thought they where referring to the pointer size.

13

u/AdBrave2400 2d ago

Isn't int 32-bit on most platforms and long long int is 64-bit?

17

u/Mateorabi 2d ago

That’s the neat part: it can depend!

sizeof() is your friend