0

c related doubt here ?

#include <stdio.h> struct { int b1: 1; int b2: 2; }bits; int main() { printf("%ld",sizeof (bits)); return 0; } what does this code mean ? and how the output is 4?

25th Jun 2020, 2:52 PM
NIK
NIK - avatar
1 Answer
+ 1
Read about bit-field here 👇 https://en.cppreference.com/w/cpp/language/bit_field
25th Jun 2020, 3:10 PM
Ipang