Reply-To: From: "Arthur" To: "DJGPP Mailing List" Subject: RE: short int and unsigned char Date: Fri, 31 Jul 1998 15:04:32 +0100 Message-ID: <000001bdbc8c$2426ae40$674e08c3@arthur> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Importance: Normal In-Reply-To: <199807302138.XAA10684@d1o22.telia.com> Precedence: bulk > Hi! > I wonder how big a short int is (in bits) and if there are anything smaller > then an unsigned char (1, 2, 4 bits). I also wonder if there is any command > to read and write a single bit in a variable. A short int (or "short") is two bytes, AKA a word. The smallest usable block of memory is a byte (unsigned char). This contains 8 bits. You can use individual bits of this char, by using methods such as bitfields etc. You can change specific bits, but not directly in binary - you have to use hex or decimal numbers. For instance, if an unsigned char is set to 0, then no bits are set. If the char is 1, then the first bit is set; if 2 then the second bit is set; if 3 then the first and second bits are both set... James Arthur jaa AT arfa DOT clara DOT net ICQ#15054819