• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

simple (any key to continue)

I have a program with instruction and i want to tell the user to hit any key to continue (including enter or spacebar), when they are done reading the instructions.  How can i do this (plus i do not want to display the character which the user typed).

Thanks
0
onestar
Asked:
onestar
  • 2
  • 2
1 Solution
 
spapCommented:
which os are you using?
try the command getch();
0
 
nietodCommented:
I believe getch() is not part of the standard c++ library.  It is only available for Microsoft Visual C++ programs.  (If that's what you are using, then its fine, but if not...)
0
 
spapCommented:
Dear nietod i feel getch() is a part of c++ library.

here is a part of bc3.1  help related to getch().

 __________________
 _getch and getche_                 <CONIO.H>
 __________________
  _ getch gets a character from console but does not echo to the screen
  _ getche gets a character from console, and echoes to the screen

 Declaration:
  _ int getch(void);
  _ int getche(void);

 Remarks:
getch reads a single character directly from the keyboard, without echoing
to the screen.
-------------------------------------------------------------------------
Any way i feel that knowing the OS and the development tool of our friend ( onestar ) is a must to answer his question precicely.

best regards.
0
 
nietodCommented:
Agreed that we need to know the OS etc.  But in the VC documentation it is not marked as being part of the ANSII C or C++ library.  They say it is part of the windows C library.  However, I don't trust the documentation completely, so it might be standard C++.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now