1.髮網絡包的代碼技巧。
union { UINT16 set; struct { UINT16 rsvd:9; UINT16 remote_stable:1; UINT16 remote_evaluating:1; UINT16 local_stable:1; UINT16 local_evaluating:1; UINT16 critical_event:1; UINT16 dying_gasp:1; UINT16 link_fault:1; }unit; }flag;
這樣,想統一改變值改變set即可。想分開改變unit.xxx即可。