Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What are bit fields? What is the use of bit fields in a structure declaration?
When ever it is necessary to pack several objects into single machine word ,one common use is a set of single bit flags in application like compiler symbol tables.It is called bit fields. A bit field is a set of adjacent bits with a single implementation.
Syntax:

struct {
     unsugned int is_keyword : 1;
     unsigned is_extern :1;
     unsigned is_static : 1 ;
       } flags ;
flags.is_extern = flags.is_static = 1 ;