According to my CCS book, the sizes are as follows: unsigned: 8 bits unsigned int: 8 bits int: 8 bits char: 8 bits long: 16 bits long int: 16 bits signed: 8 bits signed int: 8 bits signed long: 16 bits float: 32 bits short: 1 bit short int: 1 bit -----Original Message----- From: Chris Eddy [mailto:ceddy@NB.NET] Sent: Tuesday, October 17, 2000 8:37 am To: PICLIST@MITVMA.MIT.EDU 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 Chris Eddy~ "M. Adam Davis" wrote: > Bob Ammerman wrote: > > This is _not_ true. In ANSI "C", a comparison of an 'int' and an 'unsigned > > int' is performed as a 'unsigned int' comparison, _not_ a 'signed long' > > comparison. > > If so, what is the conversion? You can't represent 250 (or even 128) in a > signed int. I suppose that there is no conversion, it just refers to the uint > as an int, in which case it becomes -6. > > Well, this is a reason for good coding practices. Always cast variables when > they are dissimilar... Portability is better then, as well. > > -Adam > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST WABTEC CORPORATION CONFIDENTIALITY NOTE The content contained in this e-mail transmission is legally privileged and confidential information intended only for the use of the individual or entity named herein. If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this transmission is strictly prohibited. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST