From: "Böhme Uwe" Newsgroups: comp.os.msdos.djgpp Subject: Re: short int and unsigned char Date: Fri, 31 Jul 1998 05:40:04 +0200 Organization: Bingo (Buergernetz Ingolstadt eV) Lines: 22 Message-ID: <35C13C93.27DEF5B@hof.baynet.de> References: <199807302138 DOT XAA10684 AT d1o22 DOT telia DOT com> NNTP-Posting-Host: port62.hof.baynet.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > 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. > > Thanks in advance. I don't know weather there are packed bit arrays in ANSI. But one thing is clear. Even if there are, in most cases it's not very usefull (with very rare exception)' cause for the iXX processor there is no way to set a single bit despites the regular way with and(&) and or (|) and so you can do in C also. The sizeof operator will allways give you the size of the variable you are using. The n'th bit you get by (1<