• Array of struct within struct
    Has anyone defined an array of struct inside another struct with C51? I can find no reference document prohibiting it. Yet, when I try to compile following fragment: #include <stdio.h> struct...
  • Syntax error on struct variable initialization
    I get syntax error for valid C-syntax. It seems like the compiler thinks that the initializer of the variable must come from a constant expression whereas a variable assignment should be accepted as...
  • typedef struct error
    Hi I have code something like in hello.h #ifndef _HELLO_H #define _HELLO_H #define S16 signed short int #define S8 signed char typedef struct player { int x; int y; int score; }; extern...
  • Struct in union
    Hi I have some problems with struct inside a union This is my code. union{ unsigned char id_byte[2]; struct { unsigned char DLC:4; unsigned char RTR:1; unsigned int identifier:11; }del_element;...
  • The length of struct
    Hi, I define a struct like below: typedef struct { unsigned type :6; unsigned delete :1; unsigned mask :1; }UnitType; I think the length of this struct is 1 byte, but to my surprise,...