What will be the output of the following code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct test | |
{ | |
unsigned var1:5; | |
unsigned var2:4; | |
unsigned var3:2; | |
}; | |
int main() | |
{ | |
typedef struct test TEST; | |
TEST new_test={32,10,5}; | |
printf("var1=%d\t var2=%d\t var3=%d\t ",new_test.var1,new_test.var2,new_test.var3); | |
return 0; | |
} |
Output
var1=0 var2=10 var3=1
Explanation
No comments:
Post a Comment