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;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here