Mail Archives: djgpp/1998/07/31/09:17:41
"Johan Henriksson" <johan DOT henriksson AT borlange DOT mail DOT telia DOT com> wrote:
> I wonder how big a short int is (in bits)
DJGPP: 16.
> and if there are anything smaller then an unsigned char (1, 2, 4 bits).
No and yes. You can use bitfields to break an integer in bits. The result is
similar to an structure but inside a variable.
> I also wonder if there is any command
> to read and write a single bit in a variable.
You can use bitfields again or bit masks:
if (a & 0x80) ....
means: bit 7 of a is != 0 (b7 counting from b0).
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -