Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: "Johan Henriksson" , djgpp AT delorie DOT com Date: Fri, 31 Jul 1998 10:23:43 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: short int and unsigned char In-reply-to: <199807302138.XAA10684@d1o22.telia.com> Precedence: bulk "Johan Henriksson" 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