Mail Archives: djgpp/1997/09/30/13:31:18
> if (*Pointer>Min_Ascii_code && *Pointer++<Max_ascii_code) Num_Char++;
uuuuuhhhhhh!
> end of cycle.
if there is just one character that is < Min_Ascii_code, the "cycle" will
never end, because the *Pointer will never increase..
Is this so hard to understand? it's a common problem with the
"side-effects" in any (if-) clause! if the first argument of an
"&&"-statement doesn't fit (is NOT true), the whole statement can't be
true, and thus the second argument won't be "executed"! it's the same with
the "||"-statement (if the first is true, the statement is always true, and
thus the second argument won't be "executed", too..
this means for your example, if the first part in your if-clause is not
true (*Pointer <= Min_Ascii_code) the compiler never executes the second
part, and thus, never increases the pointer (*Pointer++).. and yo you'll
always check the same char which will never fit!
> Seby.
greets, thomas...
- Raw text -