Question:
Whats the difference with these 4 Ints i think they are,?
2009-03-22 12:48:51 UTC
75 // int
75u // unsigned int
75l // long
75ul // unsigned long
Three answers:
Ron S
2009-03-22 13:01:35 UTC
They are different types, which have different minimums and maximums. Unsigned cannot go less than 0, so the maximum is absolute value of the lowest possible SIGNED value, plus SIGNED max positive value, plus one (for zero):



AKA:



abs(signed_min) + signed_max + 1





Long's just use more bytes, and this varies per system. You will have to check your compiler's documentation.
nitaoe
2009-03-22 19:59:55 UTC
Well for that number itself, there isn't too much of a difference I don't think, but what type it is does matter for other cases.

If it's unsigned it can only be 'positive' since it has no sign, and longs can be much better than regular ints.
Vikky
2009-03-22 19:54:54 UTC
minimum and maximum range differs for different data types...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...