3 ms·
I saw the trivia question in the link article, but it doesn't provide an answer, so I ignored it. EDIT: K&R says (page 60 in my second edition): """ The for s
by jemfinch 16y ago
I saw the trivia question in the link article, but it doesn't provide an answer, so I ignored it.
EDIT: K&R says (page 60 in my second edition):
"""
The for statement
for (expr1; expr2; expr3)
statement
is equivalent to
expr1;
while (expr2) {
statement
expr3;
}
except for the behavior of continue, which is described in Section 3.7.
"""
So apparently the trivia is the behavior of `continue`, which I think most C programmers (including myself) would know implicitly, even if we couldn't answer the question itself.
- RiderOfGiraffes 16y agoAnd it's because the knowledge is implicit and used when appropriate without thinking about it, that the question is, in my opinion, pointless as an interview question, except perhaps to see how the candidate reacts to it.