Some notes about using unsigned intFebruary 08, 2023 The following for loop will never stop #include <iostream> for (unsigned i = 5; i >= 0; --i) { std::cout << i << std::endl; } The reason is that when i is 0, the result of i-1 is 4294967295 (2^32-1) since i is unsigned int.