----- Original Message ----- From: Chris Eddy To: Sent: Tuesday, October 17, 2000 8:37 AM Subject: Re: Signed Int vs Int > Hang on a millisecond.. What is the big deal over int? A signed int should be > +3286X to -3276X, and an unsigned int should be 0-65535. Whenever yall discuss > converting to -6, that applies to a char or uchar only. The confusion comes in > with compilers that have a short int, and or a long which is a 16 not 32 bit > variable. So I am still puzzled as to why everyone thinks that a int converts 250 > to -6. Someone should look on the variable types page of CCS and find out where > they stand. > > One more time: > uchar 8 bit > char 8 bit > uint 16 bit > int 16 bit > ulong 32 bit > long 32 bit Note: that 'unsigned' and 'unsigned int' are the same thing. Also: 'int' and 'signed' and 'signed int' are the same thing. ANSI SAYS (comparisons below refer to bit-size of variables): uchar >= 8 BIT char >= 8 BIT short >= 16 BIT ushort >= 16 BIT uint >= 16 BIT int >= 16 BIT ulong >= 16 BIT ! 32 bit not ensured long >= 16 BIT Also, sizeof(char) must be 1 uchar == char ushort == short uint == int ulong == long short <= int <= long You could have a conforming compiler where _everything_ was 16 bits! -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST