#include<stdio.h> int main() { struct a { float category:5; char scheme:4; }; printf("size=%d", sizeof(struct a)); return 0; }
Bit field type must be signed int or unsigned int.
The char type: char scheme:4; is also a valid statement.
Discuss About this Question.
typedef struct data mystruct; struct data { int x; mystruct *b; };
struct emp { int ecode; struct emp *e; };
#include<stdio.h> int main() { enum value{VAL1=0, VAL2, VAL3, VAL4, VAL5} var; printf("%d\n", sizeof(var)); return 0; }
#include<stdio.h> struct course { int courseno; char coursename[25]; }; int main() { struct course c[] = { {102, "Java"}, {103, "PHP"}, {104, "DotNet"} }; printf("%d ", c[1].courseno); printf("%s\n", (*(c+2)).coursename); return 0; }
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.