[Courses] [C] Beginner's Lesson 4B: Arrays, Qualifiers, and Reading Numbers

Eugene Teo eugene.teo at eugeneteo.net
Wed Oct 16 00:26:58 EST 2002


depends on the arch.
always do sizeof to check the bitsize. never trust the book.

Eugene

<quote who="Malcolm-Rannirl">
u> On Tuesday 15 October 2002 08:09 am, Lorne Gutz wrote:
u> 
u> > Note:  a short is always 16 bits and a long is 32 bits but
u> >        an int can be either 16 or 32.......maybe even 64 on
u> > some of the larger computers.
u> 
u> Not entirely true. A short is *at least* 16 bits and a long *at least* 32.
u> Longs are always at least the size of an int (so you can't have a 64 bit int 
u> and a 32 bit long, which the above suggests is possible). So you could have a 
u> short that is 32 bits on a 64 bit processor (or on a 32 bit one, but that's 
u> unlikely).
u> 
u> At least according to the C++ book, though I don't think that's an 
u> incompatibility with C (I just don't have the C reference on my desk).
u> (I seem to remember a 8bit short/16bit long machine, but that could have been 
u> with a pre-ANSI compiler).
u> 
u> -- 
u> "Don't think you are, know you are"
u> - Morpheus, 'the Matrix'
u> _______________________________________________
u> Courses mailing list
u> Courses at linuxchix.org
u> http://mailman.linuxchix.org/mailman/listinfo/courses

-- 
eMail: eugeneteo at eugeneteo.net, eugeneteo at null.cc.uic.edu
gpg pub_key: http://null.cc.uic.edu/~eugeneteo/eugeneteo.asc
main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}




More information about the Courses mailing list