4 ms·
Maybe I've forgotten more C than I'd like to admit, while (--argc > 0 && (*++argv)[0] == '-') ... Notice that the decrement always occurs before the ‘>’
by cagey 9y ago
Maybe I've forgotten more C than I'd like to admit,
while (--argc > 0 && (*++argv)[0] == '-')
...
Notice that the decrement always occurs before the ‘>’ is
evaluated. This would be true even if it were postfix (i.e., argc-- > 0).
but isn't the last statement ("This would be true even if...") in error?
IIRC a post-decrement would occur after the ‘>’ is evaluated.
edit: clarity
- kbsletten 9y agoThe decrement is the same either way, the value yielded by the decrement expression would however be different. I don't like the wording either.