weird while loop condition

I have this as a code example:

1
2
3
4
while (t--)
{
   // code goes here
}


What the hell does that evaluate to???

eg. while (i<5) would evaluate to while variable i is smaller than 5 then do something. So what does the above statement mean? while I (compiler????) post decrement the value of t do this??? WHAT?

EDIT: once again i see how it might work but here's the catch:

say t = 3, then t-- would allow 3 inputs: while (t--) {scanf...} but since the type of t is int (NOT UNSIGNED INT) then i dont know why the value would stop at 0 (or 1 inclusive).
Last edited on
because 0 is false.
(¿why should be different with unsigned int?)
aaah thank you. Still I've been trying to figure it out the whole night.
Topic archived. No new replies allowed.