|
From: Daniel G. <sp...@ho...> - 2001-10-19 15:08:33
|
<html><div style='background-color:'><DIV> <P>int holds any number from -32,332 to +32,332 (not sure about last 3 digits in each)</P> <P>and an unsigned int holds +64, 664 (again not sure about last 3)<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: "Ioannis Vranos" <NO...@YA...> <DIV></DIV>>To: "Dev-C++" <DEV...@LI...> <DIV></DIV>>Subject: RE: [Dev-C++] Unsigned and signed <DIV></DIV>>Date: Fri, 19 Oct 2001 17:54:32 +0200 <DIV></DIV>> <DIV></DIV>>signed integer variables can store both positive and negative variables, <DIV></DIV>>unsigned only positive. <DIV></DIV>> <DIV></DIV>>e.g. <DIV></DIV>>int x; <DIV></DIV>>signed int x; // They are both the same <DIV></DIV>> <DIV></DIV>>unsigned int x; <DIV></DIV>> <DIV></DIV>>long y; <DIV></DIV>>signed long y; // They are both the same <DIV></DIV>> <DIV></DIV>>unsigned long y; <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>In the case of int the "int" can be avoided: <DIV></DIV>> <DIV></DIV>>int x; <DIV></DIV>>signed x; // They are both the same <DIV></DIV>> <DIV></DIV>>unsigned x; <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>Also normally we do not use signed but only unsigned when we need so: <DIV></DIV>> <DIV></DIV>>int x; // signed <DIV></DIV>>long y; //signed <DIV></DIV>> <DIV></DIV>>unsigned z; // unsigned int <DIV></DIV>>unsigned long y; <DIV></DIV>>unsigned char c; <DIV></DIV>> <DIV></DIV>>But a char it can be signed or unsigned. It depends from the system. <DIV></DIV>> <DIV></DIV>>E.g. char c; // it can be signed or unsigned <DIV></DIV>> <DIV></DIV>>signed char c; // signed <DIV></DIV>>unsigned char c; // unsigned <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>Ioannis <DIV></DIV>> <DIV></DIV>>* Ioannis Vranos <DIV></DIV>>* Programming pages: http://www.noicys.f2s.com <DIV></DIV>>* Alternative URL: http://run.to/noicys <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> > -----Original Message----- <DIV></DIV>> > From: dev...@li... <DIV></DIV>> > [mailto:dev...@li...] On Behalf <DIV></DIV>> > Of mi...@ju... <DIV></DIV>> > Sent: Friday, October 19, 2001 1:36 PM <DIV></DIV>> > To: dev...@li... <DIV></DIV>> > Subject: [Dev-C++] Unsigned and signed <DIV></DIV>> > <DIV></DIV>> > <DIV></DIV>> > What do unsigned and signed do to variables? <DIV></DIV>> > ________________________________________________________________ <DIV></DIV>> > GET INTERNET ACCESS FROM JUNO! <DIV></DIV>> > Juno offers FREE or PREMIUM Internet access for less! <DIV></DIV>> > Join Juno today! For your FREE software, visit: <DIV></DIV>> > http://dl.www.juno.com/get/web/. <DIV></DIV>> > <DIV></DIV>> > <DIV></DIV>> > _______________________________________________ <DIV></DIV>> > Dev-cpp-users mailing list <DIV></DIV>> > Dev...@li... <DIV></DIV>> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV>> > <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |