Re: need for an extra variable.
- From: "Zero" <chefmuetze@xxxxxx>
- Date: 31 Oct 2006 02:43:54 -0800
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'.
.
- References:
- need for an extra variable.
- From: chandanlinster
- need for an extra variable.
- Prev by Date: Re: realloc(): invalid next size
- Next by Date: string search?
- Previous by thread: need for an extra variable.
- Next by thread: Re: need for an extra variable.
- Index(es):