c - respawn :1 mean in c? 是什么意思

标签 c syntax

<分区>

Possible Duplicate:
what does this mean in c int a:16; ?

这里的:1是什么意思:

...
unsigned respawn:1;
unsigned just_respawn:1;
unsigned detached:1;
unsigned exiting:1;
unsigned exited:1;
} ngx_process_t;

最佳答案

这看起来像一个 bit fieldstruct 中(您省略的 header )。 :1 表示“1 位宽”,因此在您的情况下,它们都是 bool 值。编译器应该通过按字节打包许多来优化它们的空间使用。

关于c - respawn :1 mean in c? 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6124149/

相关文章:

c++ - __declspec(align) 用于多个声明

ruby - 行为不当的案例陈述

java - 静态方法调用

syntax - 如何使用依赖于实体的其他泛型参数的泛型参数?

c - 寻找完美的 Makefile Canvas

c - 如何将新元素添加到 C 中另一个结构数组内部的数组中?

c - '[' 标记之前的汇编语言解析错误

c - 使用结构体指针的源代码

Ruby 操作符方法调用与普通方法调用

c - 我需要能够从标准输入读取字符串