Solved

simple (any key to continue)

Posted on 1998-05-08
4
212 Views
Last Modified: 2010-04-10
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
Comment
Question by:onestar
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
spap earned 20 total points
ID: 1175029
which os are you using?
try the command getch();
0
 
LVL 22

Expert Comment

by:nietod
ID: 1175030
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
 
LVL 1

Expert Comment

by:spap
ID: 1175031
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
 
LVL 22

Expert Comment

by:nietod
ID: 1175032
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now