What happens when I mix signed and unsigned types in C++?
In simple terms, if you mix types of the same rank (in the sequence of int, long int, long long int), the unsigned type “wins” and the calculations are performed within that unsigned type. The result is of the same unsigned type. If you mix types of different rank, the higher-ranked type “wins”, if it … Read more