I'm browsing freebsd code and i see this:
i don't understand the use of colon in C
this is an example: u_char ip_hl:4, ip_v:4;
anyone have an idea?
I'm browsing freebsd code and i see this:
i don't understand the use of colon in C
this is an example: u_char ip_hl:4, ip_v:4;
anyone have an idea?
These colons are used to set bit fields of structure members. u_char ip_hl:4
means u_char ip_hl
can hold only up to 4
bits.
This is to do with Bit fields. You can learn more about it by reading here