Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: getch() and getche() in MSC 4.0 Message-ID: <8719@smoke.BRL.MIL> Date: 22 Oct 88 19:07:34 GMT References: <10508@dartvax.Dartmouth.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 7 In article <10508@dartvax.Dartmouth.EDU> jalphin@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.