| View previous topic :: View next topic |
| Author |
Message |
1033430 Expert Cheater
Reputation: 0
Joined: 19 Mar 2007 Posts: 159 Location: Learning C++
|
Posted: Wed Oct 08, 2008 2:32 pm Post subject: Question About C++ |
|
|
So after I compile then run the file, I find it appearing then disappearing a split second after. I'm using Dev-C++ right now. I do have Visual C++ right now but I'm starting out with Dev-C++.
Any help would be much appreciated.
_________________
"Lifes a Bitch, because if it were a Slut, it would be to easy"
-Unknown |
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Wed Oct 08, 2008 2:40 pm Post subject: |
|
|
This question has been asked thousands of times on this forum and others,
why would the program have ANY reason at all to pause at the end of the program if you do not instruct it to?
add these two lines at the end of the main function:
| Code: |
cin.sync();
cin.ignore();
|
|
|
| Back to top |
|
 |
1033430 Expert Cheater
Reputation: 0
Joined: 19 Mar 2007 Posts: 159 Location: Learning C++
|
Posted: Wed Oct 08, 2008 2:48 pm Post subject: |
|
|
Thankyou. I think I have actually read about it. Can you also use
...(PAUSE);
or something in that area?
JW. I just started like 2 days ago.
_________________
"Lifes a Bitch, because if it were a Slut, it would be to easy"
-Unknown |
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Wed Oct 08, 2008 2:49 pm Post subject: |
|
|
| You can, but never use system("pause"), ever.
|
|
| Back to top |
|
 |
1033430 Expert Cheater
Reputation: 0
Joined: 19 Mar 2007 Posts: 159 Location: Learning C++
|
Posted: Wed Oct 08, 2008 2:51 pm Post subject: |
|
|
K thank you so much. I couldn't even get a glimpse at my work w/o that lol
_________________
"Lifes a Bitch, because if it were a Slut, it would be to easy"
-Unknown |
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Wed Oct 08, 2008 4:35 pm Post subject: |
|
|
| getchar();
|
|
| Back to top |
|
 |
dEEznutz Grandmaster Cheater
Reputation: 0
Joined: 29 Nov 2007 Posts: 514
|
Posted: Wed Oct 08, 2008 5:52 pm Post subject: |
|
|
cin.get();
_________________
Learning C++ |
|
| Back to top |
|
 |
|