MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2m4qz/bugintroduceddebugging/p6u31pu/?context=3
r/ProgrammerHumor • u/ClipboardCopyPaste • 2d ago
120 comments sorted by
View all comments
348
Is the mistake that they're allocating 1 byte and storing in a pointer to an int which is 4 bytes?
2 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. 14 u/AdBrave2400 2d ago Isn't int 32-bit on most platforms and long long int is 64-bit? 1 u/P00lnoodl 2d ago Yes but isn't the adress 8 bytes in a 64 bit system regardless of what it's pointing to?
2
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.
14 u/AdBrave2400 2d ago Isn't int 32-bit on most platforms and long long int is 64-bit? 1 u/P00lnoodl 2d ago Yes but isn't the adress 8 bytes in a 64 bit system regardless of what it's pointing to?
14
Isn't int 32-bit on most platforms and long long int is 64-bit?
1 u/P00lnoodl 2d ago Yes but isn't the adress 8 bytes in a 64 bit system regardless of what it's pointing to?
1
Yes but isn't the adress 8 bytes in a 64 bit system regardless of what it's pointing to?
348
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?