+ 3
unsigned int
What happens when I use unsigned int a and make it to negative?Does it stop at 0 or what? F.x. Int a=5; Int b=7; Unsigned int sum; Sum=a-b
3 odpowiedzi
+ 5
You cannot assign a negative value to an unsigned int. Here is an example
M means the maximum number of unsigned int
unsigned int n = 0-5;
cout << n; // prints M-4
unsigned int a = 0-1;
cout << a; // prints M
0
that's completely wrong @Lokesh
Why should it be impossible to assign a value to an unsigned int.
- 1
u cannot assign values to unsigned