Press enter to continue

From: junk mail (michael.rook_at_ntlworld.com)
Date: 02/28/04


Date: Sat, 28 Feb 2004 15:51:06 -0000

My friend is trying to code a small c program where he wants to force the
user to press enter and only enter to continue.

Currently he is using getchar() with a loop but you can type any number of
characters, which are echoed to screen before you have to press enter.

For example:-

do
        { /* Begin loop */
    printf("\Press Enter"); /* Output to screen */
          } while ((ch = getchar()) != '\n') ; /* While ( Condition -
must press enter ) */



Relevant Pages

  • Re: Beginning programmer... I need some help.
    ... you break out of `for` loop only if getchar() does /not/ return ... EOF, ... Very few profundities can be expressed in less than 80 characters. ...
    (comp.lang.c)
  • Re: OT: Brokeback Mountain question (possible spoiler)
    ... the same situation were presented with heterosexual characters, ... were straight and a female "friend" of his from his past suddenly ... I think you missed the whole point of the film - if they were open ... about their sexuality in that place at that time, ...
    (rec.arts.theatre.musicals)
  • Re: Killing a blocking thread ?
    ... I do is to create a thread that enters a loop to read. ... Friend Class ReadTCP ... Friend Sub Start ... ReadThread = New Thread ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Writing Trauma
    ... The constraints are imposed by the theme, ... the world, the characters, and the existing explicity history. ... The plot and the characters are far more important to every other ... hacker friend, leaving the protagonist to fiddle, powerless. ...
    (rec.arts.sf.composition)
  • Inaccessable Radiant heating and plumbing problems
    ... A friend of mine has a large home built in 1950. ... The house has radiant heating with copper pipe buried in the concrete. ... water sprying out of the loop via a burst pipe under the concrete. ...
    (alt.home.repair)