what i understood about signed and unsigned int is signed holds both positive and negative values and unsigned holds only positive still i am unclear what is signed and unsigned int can someone explain this with an example?How they are implemented?
Asked
Active
Viewed 83 times
-3
-
possible duplicate of [Signed versus Unsigned Integers](http://stackoverflow.com/questions/247873/signed-versus-unsigned-integers) – Marki555 Aug 02 '15 at 13:43
-
Other than using non-negative instead of positive for unsigned numbers and allowing for zero in signed numbers (zero is neither positive nor negative), your understanding is correct. But I'm pretty certain this has been asked and answered before here on SO - it may have been worth searching first. – paxdiablo Aug 02 '15 at 13:43
1 Answers
-2
- Unsigned can hold a larger positive value, and no negative value.
- Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative.
- Signed integers can hold both positive and negative numbers.
From an existing question: Signed versus Unsigned Integers