Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!yaping From: yaping@eleazar.dartmouth.edu (Yaping Xu) Newsgroups: comp.lang.c Subject: Re: getch() and getche() in MSC 4.0 Summary: Thanks! Keywords: *##%@^!&ing functions! Message-ID: <10523@dartvax.Dartmouth.EDU> Date: 21 Oct 88 13:53:38 GMT References: <10508@dartvax.Dartmouth.EDU> Sender: news@dartvax.Dartmouth.EDU Reply-To: jalphin@prism.clemson.edu Organization: Yale University Lines: 20 [This article was written by Scott Horne, not Yaping Xu. Direct all e-mail responses to me at jalphin@prism.clemson.edu.] Several people have answered my question about getch() & getche() in MSC. I didn't know that `toupper' was a macro, which it is: # define toupper(c) ( (islower(c)) ? _toupper(c) : (c) ) which caused the problem: "toupper(getch())" would evaluate to ((islower(getch()) ? _toupper(getch()) : getch()) and islower() would be expanded, and so would _toupper() be. Thus getch() is called at least twice. Thanks for pointing out my stupid mistake--and please stop filling my mailbox with responses! :-) --Scott