Here are some tests I did
printf("%ld", -1); // output 4294967295 (UINT_MAX)
printf("%ld", (long) -1); // output -1
So why does it print UINT_MAX instead of actual -1 without the type cast?
I expected both to print -1.
New contributor
Cab the Kid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.