473,537 Members | 2,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Message "Press any key to continue"

Hallo everybody.
I'm using Visual Studio 7 and hier is my question. How can i see in
Outputwindow after my Programm ended the message "Press any key to
continue". Is it possible? Now this window will closed automatisch.

Thank you
Apr 26 '06 #1
8 12848
Your window will flash some time (and this time period is so short you
wont be able to see the output) in DOS mode and you will have to add
some conio.h functions(getch() before return). But if I am not mistaken
VC++ gives you an option for you to press any key to close that black
DOS mode window so you dont need to do anything special.

This is only a suggestion: If you have the option, try to compile under
linux/Unix using g++ or under windows try programs that emulate UNIX
like environments(like cygwin...)

I do not know if I got your question right.

Regards

Apr 26 '06 #2
system("pause");
Hallo everybody.
I'm using Visual Studio 7 and hier is my question. How can i see in
Outputwindow after my Programm ended the message "Press any key to
continue". Is it possible? Now this window will closed automatisch.

Thank you

Apr 26 '06 #3
> But if I am not mistaken
VC++ gives you an option for you to press any key to close that black
DOS mode window so you dont need to do anything special.


That is the problem. I don't know, how or where can I enable this option.
The help is written part in english, part in german, so that to search the
answer there is a bad idea :(
Apr 26 '06 #4
> system("pause");

Thank you. It works.

Tim(ur)
Apr 26 '06 #5
Please do not top post, and do not trim attribution lines (added back
in).
Timur Ametov <fo*****@o2online.de> wrote:
Hallo everybody.
I'm using Visual Studio 7 and hier is my question. How can i see in
Outputwindow after my Programm ended the message "Press any key to
continue". Is it possible? Now this window will closed automatisch.

Kyle Small <ks***@sas.upenn.edu> wrote: system("pause");


This is not portable. If the OP can relax his restriction to the
<Enter> key instead of any key, then a portable way to do this is
something like:

std::cout << "Press <Enter> to continue\n";
std::string trash;
std::getline(std::cin, trash);

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Apr 26 '06 #6
I believe the Press any key message appears automagically in Visual C++
when running one of the Debug or Release builds, not sure exactly which
one (it's the one you're not currently using)./

Apr 26 '06 #7
> I believe the Press any key message appears automagically in Visual C++
when running one of the Debug or Release builds, not sure exactly which
one (it's the one you're not currently using)./


I also believed that, but it is not so and i don't know where can i enable
this feature.

Tim
Apr 27 '06 #8
Timur Ametov wrote:
I believe the Press any key message appears automagically in Visual
C++ when running one of the Debug or Release builds, not sure
exactly which one (it's the one you're not currently using)./


I also believed that, but it is not so and i don't know where can i
enable this feature.


OT, but my version of VSC++6 certainly does that.

If you have trouble setting up your IDE, you need to go to a newsgroup
dedicated to it. This is not the place to discuss your implementation.

If you want a platform-independent method, request the users to HIT CR
TO CONTINUE and use some sort of read from standard in to consume all
input up to the new-line.


Brian
Apr 27 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
580
by: Harman Sahni | last post by:
As per this URL http://msdn.microsoft.com/library/en-us/vjref98/html/14_14.asp?frame=true conitnue works on for, while, do... I know it works for foreach as well as I'm using it somewhere. My question is how do I "continue" (jump an iteration) of an outermost loop from an inner loop. So I have something like this:
2
4508
by: Paul Johnston | last post by:
I'm using VB.Net. I've tried using Console.Read() but it requires a line-terminator before it finishes (doesn't that mean it's functionally equivalent to ReadLine() -- why have it then?). I've tried Console.In.ReadBlock(), too, with no success. So, along these lines, how would I implement, simply, a "Press Any Key to Continue" routine or,...
14
3614
by: Daniel Bass | last post by:
is there an equivalent key word for C++'s "continue" in VB (.net) in this context? CString szLine; szLine = myReader.ReadLine(); while ( !szLine.IsEmpty() ) { if ( szLine(0) == '-' ) {
9
64320
by: Susan Rice | last post by:
I'm running a simple win32 console application and I want to impliment a "Press any key to continue", so I print that prompt, and then what's the easiest way to impliment reading any key? Do I use 'getchar', or 'gets', or some get function? or 'cin', or what's an easy way? What I want is the program to pause before exiting so the user can...
13
1985
by: xz | last post by:
What if I want the following: vector<intv; // v is loaded by push_back() switch( v.size() ) { case 2: //do something
36
2618
by: mdh | last post by:
May I ask the group this somewhat non-focused question....having now seen "continue" used in some of the solutions I have worked on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind) Is there a good principle/s for the good usage of "continue"...or...do any of the regular/irregular contributors have a "favorite" way in which it is...
0
7534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7687
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7277
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7644
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4846
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3347
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1759
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 we have to send another system
1
927
muto222
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.