|
读代码时发现的,语法肯定正确,希望寻求解释,摘录一段如下:
/*bsock.h */
struct BSOCK {
......
volatile bool timed_out: 1; /* timed out in read/write */
volatile bool terminated: 1; /* set when BNET_TERMINATE arrives */
bool duped: 1; /* set if duped BSOCK */
bool spool: 1; /* set for spooling */
......
BSOCK *next; /* next BSOCK if duped */
......
};
结构体中的bool类型变量使用冒号赋值(?),我不理解在结构声明中怎么可以赋值,而且用冒号赋值,煞是奇怪。 |
|