For Programmers: Free Programming Magazines  


Home > Archive > C > June 2006 > Re: How to prevent the quick disappearance of window









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to prevent the quick disappearance of window
Keith Thompson

2006-06-28, 6:56 pm

"Robert Gamble" <rgamble99@gmail.com> writes:
> Jordan Abel wrote:
>
> It's worth noting that simply calling getchar() will leave all
> characters except the first one on the input stream if the user entered
> any before pressing the "return" key which may not be desirable. In
> such a case something like "while(getchar() != '\n')" may be preferred.


This won't matter if it's the last thing you do before terminating the
program, but it's (almost) always a good idea to write code that could
be incorporated into something bigger later on.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com