Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #9347

Re: What is the use of ':' in type definition?

From Nobody <nobody@nowhere.com>
Subject Re: What is the use of ':' in type definition?
Date 2011-08-13 15:10 +0100
Message-Id <pan.2011.08.13.14.10.04.898000@nowhere.com>
Newsgroups comp.lang.c
References <a46e730f-78dc-4188-b837-71b3221a68fa@k15g2000yqd.googlegroups.com>
Organization Zen Internet

Show all headers | View raw


On Sat, 13 Aug 2011 06:49:53 -0700, fl wrote:

>   uint_T is_c1_c4e : 4;
>   uint_T is_active_c1_c4e : 1;
> } SFc1_c4eInstanceStruct;
> 
> 
> I do not understand the ':' in last two line definitions. I guess it
> is about 4 bytes, or 4X(16 bit word) alignment? Please tell me some
> because I do not use C a lot. Thanks.

It indicates a bitfield, i.e. 4 bits and 1 bit respectively.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What is the use of ':' in type definition? fl <rxjwg98@gmail.com> - 2011-08-13 06:49 -0700
  Re: What is the use of ':' in type definition? Nobody <nobody@nowhere.com> - 2011-08-13 15:10 +0100
  Re: What is the use of ':' in type definition? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 10:57 -0400
    Re: What is the use of ':' in type definition? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2011-08-13 14:28 -0400
      [OT] Re: What is the use of ':' in type definition? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 17:39 -0400
  Re: What is the use of ':' in type definition? "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-13 17:40 +0200

csiph-web