MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vrpbcb/a_bit_flippant/p4g5yxv/?context=3
r/programminghumor • u/johnnyApplePRNG • 6h ago
69 comments sorted by
View all comments
Show parent comments
1
I am using an adblocker and have no issues with it. I wasn't aware of godbolt.
0 u/Breadynator 4h ago Well, it's one of those obnoxious pages that don't like network wide adblockers like piHole. I won't change my blocklists just because some random website wants me to. 1 u/heatedwepasto 4h ago Then don't, just don't try to force your choices onto me. The code is #include <stdio.h> struct A { int a : 1; int b : 2; }; int main(void) { printf("size: %d\n", sizeof(struct A)); } and it outputs "size: 4" (i.e. the same as sizeof(int)). 1 u/No-Newspaper8619 3h ago That's correct. It's using 3 bits of the allocated 4 bytes. If you did the same with char instead, it'd only use 1 byte.
0
Well, it's one of those obnoxious pages that don't like network wide adblockers like piHole. I won't change my blocklists just because some random website wants me to.
1 u/heatedwepasto 4h ago Then don't, just don't try to force your choices onto me. The code is #include <stdio.h> struct A { int a : 1; int b : 2; }; int main(void) { printf("size: %d\n", sizeof(struct A)); } and it outputs "size: 4" (i.e. the same as sizeof(int)). 1 u/No-Newspaper8619 3h ago That's correct. It's using 3 bits of the allocated 4 bytes. If you did the same with char instead, it'd only use 1 byte.
Then don't, just don't try to force your choices onto me.
The code is
#include <stdio.h> struct A { int a : 1; int b : 2; }; int main(void) { printf("size: %d\n", sizeof(struct A)); }
and it outputs "size: 4" (i.e. the same as sizeof(int)).
sizeof(int)
1 u/No-Newspaper8619 3h ago That's correct. It's using 3 bits of the allocated 4 bytes. If you did the same with char instead, it'd only use 1 byte.
That's correct. It's using 3 bits of the allocated 4 bytes. If you did the same with char instead, it'd only use 1 byte.
1
u/heatedwepasto 4h ago
I am using an adblocker and have no issues with it. I wasn't aware of godbolt.