|
From: Noorez K. <coo...@ho...> - 2004-01-04 04:24:48
|
There are somethings i don't understand. I thought that you needed the windows.h file to use the UINT for unsigned int? When I was programing for MS-DOS i never saw the UINT for unsigned int. and what would this program line do #define true 0 and what is an unsigned char? _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca |
|
From: P.T. W. M. <pt...@ea...> - 2004-01-04 04:42:43
|
An unsigned int is an unsigned integer which is an integer from 0 to the maximum value that sizeof(int) will hold on your system which is the value it would take on if all the bits were 1's. This is on many systems the default for "int". This is as compared to a signed int which uses the most significant bit of the byte or word to determine the "sign" (positive or negative) of the variable. Such bytes (or words) are then interpreted as negative. UINT is either a pre-processor macro, or (more likely) a typedef (alias) for unsigned int. For example: // Define an alias for unsigned int type typedef UINT unsigned int then to do this: // Standard way unsigned int uivar // You can now do this UINT uivar This typedef might be a part of windows.h... do a grep for it. At 20:24 03-01-04, Noorez Kassam wrote: >There are somethings i don't understand. > >I thought that you needed the windows.h file to use the UINT for unsigned >int? When I was programing for MS-DOS i never saw the UINT for unsigned int. > >and what would this program line do >#define true 0 > >and what is an unsigned char? > >_________________________________________________________________ >The new MSN 8: smart spam protection and 2 months FREE* >http://join.msn.com/?page=features/junkmail >http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > >------------------------------------------------------- >This SF.net email is sponsored by: IBM Linux Tutorials. >Become an expert in LINUX or just sharpen your skills. Sign up for IBM's >Free Linux Tutorials. Learn everything from the bash shell to sys admin. >Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Per W. <pw...@ia...> - 2004-01-04 10:14:12
|
No, there are no compilers where int is default unsigned. However, the char data type might be default signed or unsigned. If unsigned, it will store - at least - the range 0..255 while a signed char will store - at least - -128..+127. /Per W On Sat, 3 Jan 2004, P.T. Waugh MA wrote: > An unsigned int is an unsigned integer which is an integer from 0 to the > maximum value that sizeof(int) will hold on your system which is the value > it would take on if all the bits were 1's. This is on many systems the > default for "int". This is as compared to a signed int which uses the most > significant bit of the byte or word to determine the "sign" (positive or > negative) of the variable. Such bytes (or words) are then interpreted as > negative. > > UINT is either a pre-processor macro, or (more likely) a typedef (alias) > for unsigned int. > > For example: > > // Define an alias for unsigned int type > typedef UINT unsigned int > > then to do this: > > // Standard way > unsigned int uivar > > // You can now do this > UINT uivar > > This typedef might be a part of windows.h... do a grep for it. > > At 20:24 03-01-04, Noorez Kassam wrote: > >There are somethings i don't understand. > > > >I thought that you needed the windows.h file to use the UINT for unsigned > >int? When I was programing for MS-DOS i never saw the UINT for unsigned int. > > > >and what would this program line do > >#define true 0 > > > >and what is an unsigned char? > > > >_________________________________________________________________ > >The new MSN 8: smart spam protection and 2 months FREE* > >http://join.msn.com/?page=features/junkmail > >http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: IBM Linux Tutorials. > >Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > >Free Linux Tutorials. Learn everything from the bash shell to sys admin. > >Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: P.T. W. M. <pt...@ea...> - 2004-01-04 11:24:38
|
Thanks for the corrections =) At 20:24 03-01-04, Noorez Kassam wrote: >There are somethings i don't understand. > >I thought that you needed the windows.h file to use the UINT for unsigned >int? When I was programing for MS-DOS i never saw the UINT for unsigned int. > >and what would this program line do >#define true 0 > >and what is an unsigned char? > >_________________________________________________________________ >The new MSN 8: smart spam protection and 2 months FREE* >http://join.msn.com/?page=features/junkmail >http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > >------------------------------------------------------- >This SF.net email is sponsored by: IBM Linux Tutorials. >Become an expert in LINUX or just sharpen your skills. Sign up for IBM's >Free Linux Tutorials. Learn everything from the bash shell to sys admin. >Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Per W. <pw...@ia...> - 2004-01-04 11:32:00
|
I hope you have never seen any code doing #define true 0 since the compiler treats any non-zero value as TRUE, i.e. the reverse condition. Also, in c++ true is reserved word, just like int or char, so in C++ you don't have to #define anything. A lot of C code are using #define FALSE 0 #define TRUE 1 or possibly #define FALSE 0 #define TRUE (!FALSE) /Per W On Sat, 3 Jan 2004, Noorez Kassam wrote: > There are somethings i don't understand. > > I thought that you needed the windows.h file to use the UINT for unsigned > int? When I was programing for MS-DOS i never saw the UINT for unsigned int. > > and what would this program line do > #define true 0 > > and what is an unsigned char? > > _________________________________________________________________ > The new MSN 8: smart spam protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |