What does respawn:1 mean in c? [duplicate]
Possible Duplicate:
what does this mean in c int a:16; ?
What does the :1
mean here:
...
unsigned respawn:1;
unsigned just_respawn:1;
unsigned detached:1;
unsigned exiting:1;
unsigned exited:1;
} ngx_process_t;
This looks like a bit field in a struct
(the header you omitted). The :1
means "1 bit wide", so in your case, they're all booleans. The compiler is supposed to optimize their space usage by packing many of them per byte.
respawn is a bitfield which is 1 bit wide, so it can take on the value of 0 or 1.
精彩评论