• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

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

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
kor786
Asked:
kor786
  • 2
1 Solution
 
jkrCommented:
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
 
kor786Author Commented:
Thanks, It Works!
0
 
jkrCommented:
Grat. BTW, don't forget to close your questions once your problem is solved ;o)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now