Colons after variable name in C

eonil picture eonil · Oct 21, 2010 · Viewed 19.7k times · Source

Possible Duplicate:
What does a colon in a struct declaration mean, such as :1, :7, :16, or :32?

This is C code sample of a reference page.

      signed int _exponent:8;

What's the meaning of the colon before '8' and '8' itself?

Answer

EboMike picture EboMike · Oct 21, 2010

It's a bitfield. It's only valid in a struct definition, and it means that the system will only use 8 bits for your integer.