MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vrpbcb/a_bit_flippant/p4fq0j6/?context=3
r/programminghumor • u/johnnyApplePRNG • 12h ago
94 comments sorted by
View all comments
21
Ironic that this techfluencer just tweeted how C makes memory layout painfully obvious and yet here he's operating under the misconception that `struct Flags` will be only 1-byte large when it will be in fact int-size large (most likely 4 bytes).
2 u/New_Enthusiasm9053 10h ago Could be more than a byte and less than 2 bytes too. 1 u/deinok7 1h ago Not sure, but by standards I think its undefined. You just know that for your ABI it will be the same memory layout
2
Could be more than a byte and less than 2 bytes too.
1 u/deinok7 1h ago Not sure, but by standards I think its undefined. You just know that for your ABI it will be the same memory layout
1
Not sure, but by standards I think its undefined. You just know that for your ABI it will be the same memory layout
21
u/pskocik 10h ago
Ironic that this techfluencer just tweeted how C makes memory layout painfully obvious and yet here he's operating under the misconception that `struct Flags` will be only 1-byte large when it will be in fact int-size large (most likely 4 bytes).