Solved

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

Posted on 2009-04-11
5
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

689 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