Re: need for an extra variable.




chandanlinster schrieb:

hello everybody,
consider the following code snippet (from K & R, pg78)

while ((s[0] = c = getch()) == ' ' || c == '\t')
;

my question is, why would we need the variable 'c'.
We could easily write it as,

while ((s[0] = getch()) == ' ' || s[0] == '\t')
;

I don't know the whole code,
but with the code above c gets also the value from getch()
and will be checked immediately with c=='\t'.

.