When I printed value of b using two of ways, I though it should be the same output on the console, but it didn't.
unsigned int b = -1000;
std::cout << b << std::endl;
printf("%d\n",b);
Output:
cout: 4294966296
printf: -1000
The correct value of b should be around 0 -> 4294967296. The output of cout is correctly. However, I did not understand why the printf keeping wrong value?
Can anyone explain to me ?