请问各位":1"是什么意思啊.

thunk123 2008-11-15 01:21:42
typedef struct BPP {

//
// Mark flags
//
ULONG fNewMark :1; // Newly Marked
ULONG fMarkAdd :1; // Mark for addition
ULONG fMarkDelete :1; // Mark for deletion
ULONG fMarkDisable :1; // Mark for disable
ULONG fMarkEnable :1; // Mark for enable
ULONG fMarkChange :1; // Mark for change
ULONG fReplacement :1; // Replaces a changed BP

//
// Flags to determine breakpoint type
//
ULONG fWndProc :1; // Window Proc BP: Requires fCodeAddr
ULONG fCodeAddr :1; // Code Addr. BP
ULONG fExpression :1; // Expression BP
ULONG fMemory :1; // Memory BP
ULONG fMsg :1; // Msg BP
ULONG fMsgClass :1; // Msg is Msg class (i.e. mask)
ULONG fMsgParsed :1; // Msg has been parsed
ULONG fTemporary :1; // Temp BP, for gountil

//
// Other flags
//
ULONG fHighlight :1; // Is the highlight currently marked?
ULONG fQuiet :1; // Quiet defer
ULONG fProcess :1; // Process set
ULONG fThread :1; // Thread set









请问各位":1"是什么意思啊.
...全文
2308 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ningweidong 2008-11-18
  • 打赏
  • 举报
回复
就是位域,谭浩强的书上解释的有。
所位域不能跨越一个字节,所有位加起来不能超过八位。
thunk123 2008-11-16
  • 打赏
  • 举报
回复
还有,它们内部可能使用使用联合体吧
thunk123 2008-11-16
  • 打赏
  • 举报
回复
非常感谢楼上两位朋友.请问是这是 c标准吗?
xiaopoy 2008-11-15
  • 打赏
  • 举报
回复
结构里面的
:1
说明这个符号指向的是1 bit
读取这个符号时,就会放弃ULONG长度中其他的bit
「已注销」 2008-11-15
  • 打赏
  • 举报
回复
整个struct的长度将是ULONG的整数倍
「已注销」 2008-11-15
  • 打赏
  • 举报
回复
这句话“所有的位段宽度加起来应该不超多ULONG的bit长度。”是错误的。
「已注销」 2008-11-15
  • 打赏
  • 举报
回复
这个struct应该称为位段,
:1就是这个位段宽度是1。也可以是其他长度的。
所有的位段宽度加起来应该不超多ULONG的bit长度。

70,023

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧