Point out the error in the following code: struct any_struct { short s : 20; int i : 4; } Locate the errors in the following program so it prints X.x correctly. For X.x to have the value 300, what...


Point out the error in the following code:


struct any_struct {


short s : 20;


int i : 4;


}


Locate the errors in the following program so it prints X.x correctly. For X.x to have the value


300, what changes are required to be made in the program?


#include


int main(void)


{


struct x {


short x : 4;


} X;


X.x = 8;


printf(“sizeof x = %hd\n”, sizeof(x));


printf(“x.x = %hd\n”, X.x);


return 0;


}



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here