Solved

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

Posted on 2009-04-11
5
353 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countClumps  challenge 10 111
sumHeights  challenge 17 66
Dynamically allocate memory 9 56
Microsoft C++ code failing in executable that worked 9 85
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now