getch() and getche() in MSC 4.0
Doug Gwyn
gwyn at smoke.BRL.MIL
Sun Oct 23 05:07:34 AEST 1988
In article <10508 at dartvax.Dartmouth.EDU> jalphin at prism.clemson.edu writes:
> c = toupper(getch());
The problem is almost certainly due to toupper() being implemented as an
"unsafe" macro, i.e. one that evaluates its argument more than once, so
that if the argument has side-effects the result is different from what
a function toupper() would have done. Obviously getch() has side-effects.
More information about the Comp.lang.c
mailing list