Member • Nov 16, 2016
how this program of C works and what is the output
#include
void main()
{
struct value
{
int bit1:2;
int bit3:4;
int bit4:4;
}bit={1,2,13};
printf("%d %d %d\n",bit.bit1,bit.bit3,bit.bit4);
}
Member • Nov 16, 2016
#include
void main()
{
struct value
{
int bit1:2;
int bit3:4;
int bit4:4;
}bit={1,2,13};
printf("%d %d %d\n",bit.bit1,bit.bit3,bit.bit4);
}
Member • Nov 21, 2016
The code given is an example of bit manipulation in C.jasim92how this program of C works and what is the output
Member • Nov 23, 2016
Thank you Rahulrahul69The code given is an example of bit manipulation in C.
The first element of the structure is assigned a space of 2 bits and next two are given 4 bits each.
Since int is used (signed integers), the output will be 1,2,-3.
Member • Nov 24, 2016