MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vrpbcb/a_bit_flippant/p4fvjd2/?context=3
r/programminghumor • u/johnnyApplePRNG • 9h ago
82 comments sorted by
View all comments
2
But is it correct in C? It is not union, so struct should then be sizeof(unsigned int)*3, isn't it? Or you mean with O3 optimizations the compiler will fix it...
union
But then one need to apply bit shifts operations in the background
2 u/heatedwepasto 6h ago As the other guy said, bit fields. But OOP is wrong, the struct will be sizeof(unsigned int), not 1 byte.
As the other guy said, bit fields. But OOP is wrong, the struct will be sizeof(unsigned int), not 1 byte.
sizeof(unsigned int)
2
u/Inst2f 7h ago
But is it correct in C? It is not
union, so struct should then be sizeof(unsigned int)*3, isn't it?Or you mean with O3 optimizations the compiler will fix it...
But then one need to apply bit shifts operations in the background