473,900 Members | 4,105 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 12888
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(li ke 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*****@o2onli ne.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.upen n.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(st d::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
4549
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, more complex, a text menu in a Console app to get a single character? i.e.
14
3675
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
64509
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 read whatever messages there are before the console window disappears.
13
2020
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
2686
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 particularly useful. Thanks as usual.
0
9997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9845
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11276
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10866
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10976
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5891
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4721
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
2
4301
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.