+ 2

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 ?

3rd Dec 2019, 12:14 AM
Celestino🇰🇪🇫🇷
Celestino🇰🇪🇫🇷 - avatar
4 Answers
+ 2
unsigned means it cannot be a negative number . int, can be negative or positive number.
3rd Dec 2019, 12:18 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 2
bahha is right and what’s more the range is different,too int :-2^31 ~ 2^31 unsigned int:0~2^32
3rd Dec 2019, 4:26 AM
Snow
Snow - avatar
0
A-Z
4th Dec 2019, 10:00 PM
កូននឹកម៉ាក់ ប៉ា កូននឹកម៉ាក់ ប៉ា
កូននឹកម៉ាក់ ប៉ា កូននឹកម៉ាក់ ប៉ា - avatar