473,471 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pressing any key to continue

60 New Member
Hi Guys,

I want a user to press any key inorder for the program to move, say, from one segment to another. Any ideas as how to do it
Jun 25 '07 #1
8 1722
ssorower
23 New Member
Hi,
You might want to use kbhit() [The equivalent Microsoft Visual C++ function is _kbhit().) ] function as in here .

Thanks,
Sorower
Jun 25 '07 #2
niskin
109 New Member
Hi Guys,

I want a user to press any key inorder for the program to move, say, from one segment to another. Any ideas as how to do it
I suggest you use:

Expand|Select|Wrap|Line Numbers
  1. system("PAUSE");
Jun 26 '07 #3
sicarie
4,677 Recognized Expert Moderator Specialist
Hi Guys,

I want a user to press any key inorder for the program to move, say, from one segment to another. Any ideas as how to do it
Why not just use the input file stream functions, like cin or scanf and then disregard the variable that is input?
Jun 26 '07 #4
r035198x
13,262 MVP
Why not just use the input file stream functions, like cin or scanf and then disregard the variable that is input?
<nit>
I have to say

Expand|Select|Wrap|Line Numbers
  1. system("PAUSE");
looks cleaner though.
</nit>
Jun 26 '07 #5
sicarie
4,677 Recognized Expert Moderator Specialist
<nit>
I have to say

Expand|Select|Wrap|Line Numbers
  1. system("PAUSE");
looks cleaner though.
</nit>
I'd agree - if you don't comment your code ;).

Just kidding, I personally attempt to stay away from the system() command where I can, but that's - as I said - personal preference.
Jun 26 '07 #6
seforo
60 New Member
When using system("PAUSE") I get the bug that the command PAUSE not found.
I also cannot use cin because, if say I press b, I still have to press the return key in order to continue. What I need is something close to like after executing a program using visual studio on windows. You just press any key and the execution window vanishes
Jun 27 '07 #7
niskin
109 New Member
When using system("PAUSE") I get the bug that the command PAUSE not found.
Try opening up the command prompt to see whether the pause command does actually work.
Jun 27 '07 #8
sicarie
4,677 Recognized Expert Moderator Specialist
If you're not worried about portability, you could use conio.h's getch().
Jun 27 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: qwweeeit | last post by:
Hi all, Elliot Temple on the 1 June wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no...
2
by: Rudy Ray Moore | last post by:
Visual studio c++ 7.1/.net/2003 got me in the habit of pressing ESC after performing a search using CTRL-F. I've always thought the extra step (pressing ESC) was dumb, but could not come up with...
2
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a...
3
by: yuelinniao | last post by:
hi, I have got a simple way to make "textarea" support "auto-submit" when pressing Ctrl+Enter, and tested under both IE and Firefox. The common old method is like this: <form name=form2>...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
9
by: Camellia | last post by:
Hi all, I'll get straight into it. When I try to run the code: ..... while (scanf("%c", &c) == 1) printf("%c", c); ..... I input "abcd" follows by an EOF(Ctrl + d) instead of pressing...
1
by: Camellia | last post by:
Hi all, I'll get straight into it. When I try to run the code: ..... while (scanf("%c", &c) == 1) printf("%c", c); ..... I input "abcd" follows by an EOF(Ctrl + d) instead of pressing...
18
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same...
1
by: GlennMBella2 | last post by:
this is probably basic, however I ahve a form with number of buttons and upon pressing certain buttons as part of hte buttons press function, i would like to update a table (communications) with...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.