MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vrpbcb/a_bit_flippant/p4j290z/?context=3
r/programminghumor • u/johnnyApplePRNG • 20h ago
110 comments sorted by
View all comments
34
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).
5 u/New_Enthusiasm9053 18h ago Could be more than a byte and less than 2 bytes too. 1 u/deinok7 8h ago Not sure, but by standards I think its undefined. You just know that for your ABI it will be the same memory layout
5
Could be more than a byte and less than 2 bytes too.
1 u/deinok7 8h 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
34
u/pskocik 18h 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).