C++:What is the difference between "unsigned int i" and "int i" ?

Saw this in a challenge question as well as in a written program. What does the "unsigned" mean ?

12/3/2019 12:14:06 AM


4 Answers

New Answer


unsigned means it cannot be a negative number . int, can be negative or positive number.


bahha is right and what’s more the range is different,too int :-2^31 ~ 2^31 unsigned int:0~2^32


Celestino🇰🇪🇫🇷 What do you mean by "sure??"? https://stackoverflow.com/questions/9045436/the-real-difference-between-int-and-unsigned-int