MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2m4qz/bugintroduceddebugging/p6vpz88/?context=3
r/ProgrammerHumor • u/ClipboardCopyPaste • 2d ago
120 comments sorted by
View all comments
343
Is the mistake that they're allocating 1 byte and storing in a pointer to an int which is 4 bytes?
1 u/mckenzie_keith 2d ago x is a variable of type pointer to int. You can put x on the left side of a malloc() call. You can also free x. There is no bug up to that point.
1
x is a variable of type pointer to int. You can put x on the left side of a malloc() call. You can also free x. There is no bug up to that point.
343
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?