Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
data scientists and AI 17 108
How to gracefully close the c++ 11 thread? 3 94
What language/protocol is the Angular Chat? 2 73
Issues with C++ Class 19 92
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

786 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