Article View: chile.comp.programacion
Article #3431Re: Consulta notaci?n en C
From: Andres Pereira
Date: Mon, 17 Jan 2005 15:56
Date: Mon, 17 Jan 2005 15:56
33 lines
1700 bytes
1700 bytes
?lvaro Palma <Nmena@unicit.cl> wrote:
> Que significa la notaci�n ":" en este caso:
El n�mero de bits ocupados por el campo de bits
en memoria.
> typedef union {
> struct rgb {
> unsigned int b:8; <---- AQU�
> unsigned int g:8; <---- AQU�
> unsigned int r:8; <---- AQU�
> unsigned int a:8; <---- AQU�
> } rgb;
> unsigned int raw;
> } tPixel;
> Significa que s�lo se usan los 8 bits menos significativos de la variable?
Significa que la estructura rgb ocupa al menos 4 bytes (32 bits),
y se divide en cuatro campos de bits:
a -> 0 - 7
g -> 8 - 15
r -> 16 - 23
b -> 24 - 31
Hay m�s detalles sobre los bit-fields, que los puedes encontrar
en alg�n manual sobre C.
Saludos,
--
Andr�s Pereira.
Technical Details
Message-ID:
<csgn7b$ida$1@helcaraxe.dcc.uchile.cl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mailReferences:
<csgh3o$aq0$1@localhost.localdomain>Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,9c2e98683d122664 X-Google-Attributes: gid1593cb,public X-Google-Language: SPANISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mail From: Andres Pereira <anpereir@dcc.uchile.cl> Newsgroups: chile.comp.programacion Subject: Re: Consulta notaci?n en C Date: Mon, 17 Jan 2005 15:56:27 +0000 (UTC) Organization: DCC - Universidad de Chile Lines: 33 Message-ID: <csgn7b$ida$1@helcaraxe.dcc.uchile.cl> References: <csgh3o$aq0$1@localhost.localdomain> NNTP-Posting-Host: 192.80.24.3 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: helcaraxe.dcc.uchile.cl 1105977387 18858 192.80.24.3 (17 Jan 2005 15:56:27 GMT) X-Complaints-To: newsmaster@dcc.uchile.cl NNTP-Posting-Date: Mon, 17 Jan 2005 15:56:27 +0000 (UTC)