From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: # bits in int,char, long, shrttt Date: Wed, 30 Apr 1997 19:28:11 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 34 Message-ID: <33679D4B.3E02@cs.com> References: <5k81fu$jah$1 AT d2 DOT tufts DOT edu> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp213.cs.com 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 Brett J. Wiesner wrote: > > could someone tell me how many bits there are in each of these: > int > long > char > short > long long > > under djgpp of course. im using a pentium if it matters. How about this: write a program that prints the size of all the types: #include int main( void ) { printf( "char = %lu\n", sizeof(char) ); printf( "short = %lu\n", sizeof(short) ); /* etc. */ return 0; } I did exactly that when I wanted to test the type sizes under djgpp. The great thing about such a program is that it can be reused with any compiler. -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | "Starting flamewars since 1993" | http://www.cs.com/fighteer | | *** NOTICE *** This .signature is generated randomly. | | If you don't like it, sue my computer. | ---------------------------------------------------------------------