Solved

C++ Console Application Closing As Soon As It's Done Processing.

Posted on 2009-04-11
5
370 Views
Last Modified: 2012-05-06
When Ever I Click On My C++ Console Application It Closes As Soon It's Done Processing. How Can I Prevent It From Doing This?
0
Comment
Question by:kor786
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 24122532
There are two simple way to prevent that, both based on the user having to press a key. You can either just wait for some input using e.g.

system("pause");

or

char dummy[100];
scanf("%c",dummy);

or

char dummy[100];
cin >> dummy;
0
 

Author Comment

by:kor786
ID: 24124643
Thanks, It Works!
0
 
LVL 86

Expert Comment

by:jkr
ID: 24125621
Grat. BTW, don't forget to close your questions once your problem is solved ;o)
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

829 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