Pages: [1]   Go Down
Author Topic: please help what this ":" command means  (Read 458 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you please explain what this ":" command means.

Code:
int8_t rtr : 1;

thank you.
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Used in a structure, it defines a bit-field. That particular example defines rtr to be a single bit, assuming it is part of a structure.

http://en.wikipedia.org/wiki/C_syntax#Bit_fields
http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=%2Fcom.ibm.vacpp6m.doc%2Flanguage%2Fref%2Fclrc03defbitf.htm
Logged


Pages: [1]   Go Up
Jump to: