Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questio about C syntax

Status
Not open for further replies.

tarch

Programmer
Jan 30, 2006
1
IT
Hi all,
and I found this declaration:

__u8 local_df:1;

so __u8 is the type, my question is what is the ":1" after the variable name?

Bye, and thank you.
 
It's a bit field declaration of a member of a structure. Obviously, __u8 is typedef'ed name (probably, alias of unsigned char). So it's 1 bit length value packed within a byte. Now you may get (or put this bit via assignment) this bit (str.local_df or what else).
Alas, bit field allocation and alignment within a structure object is implementation-defined by C Standard...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top