PDA

Click to See Complete Forum and Search --> : unsigned int


MPrestonf12
Feb 22nd, 2001, 10:26 AM
when do you use a unsigned integer. Is there a appropriate case? Thanks

Vlatko
Feb 22nd, 2001, 11:09 AM
Well. Not any special cases. It depends of the variable.
If you are sure that the variable will never have to hold a negative value but only positive values then use an unsigned variable (integer).

Unsigned integers can only hold positive values.

Feb 22nd, 2001, 02:10 PM
Unsigned anything can only hold positive values.

Feb 22nd, 2001, 03:10 PM
You would also use it when you need a bigger number. For example, the long datatype can only go up to approx. 2 billion, but when unsigned, it can go up to 4 billion.

Technocrat
Feb 22nd, 2001, 03:31 PM
It is also used alot in APIs and DLLS.

MPrestonf12
Feb 23rd, 2001, 09:06 AM
thanks for the responces!