473,490 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create 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 12840
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...
2
4499
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...
14
3608
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
64286
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...
13
1981
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
2614
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...
0
6974
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...
0
7146
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
7356
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...
1
4878
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
4573
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
3084
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
1389
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 ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.