I can't understand what the following code is doing on s
:
if(!s--)
s
is an int
!
is called negation
operator. It is a logical operator.
See the wikipedia entry here.
if(!s--)
The order in which it executes
s
is 0
or not , if s
is 0
, if
condition is success [thanks to the !
operator], otherwise, failure. s
by one unit.if
condition, continue the execution [code under if
condition, or next block of code].