Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 06-14-2004, 01:48 PM   #1 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 8

Tallyrand

Default pause command for c++

#include <iostream>

int main ()
{
using namespace std;

cout << "Text";

return 0;
}
----------------------------------------------------------------------------------
the console screen shuts whenever i open it how would i pause it so it wont shut.
Tallyrand is offline  
Old 06-15-2004, 01:04 PM   #2 (permalink)
 
Junior Techie

Join Date: Oct 2003

Posts: 85

zoerb

Default

try including conio.h and call the function getch();
__________________
Asus A7n8x-x
athlon 2800
radeon 9600 pro
512 mb 2700 mem
western digital 80gb special edition
zoerb is offline  
Old 06-15-2004, 09:58 PM   #3 (permalink)
 
True Techie

Join Date: Jun 2004

Posts: 106

spartanM19SSM

Default

Well, first, are you using C++.NET? If you are then instead of that use cin.ignore(); on a line before the return statement...
__________________
OSS and Linux is the way to go!!!
tuxxman.homelinux.net
spartanM19SSM is offline  
Old 07-15-2004, 12:51 PM   #4 (permalink)
 
True Techie

Join Date: Jan 2004

Posts: 164

petogaz

Default

if you're using DevC++ include system("PAUSE") on a line before return 0.
__________________
\"you cant hold a good techie down\"
petogaz is offline  
Old 07-22-2004, 08:43 AM   #5 (permalink)
 
Junior Techie

Join Date: Nov 2002

Posts: 68

Deathwalker

Default

If you include the windows.h file you can use the Sleep();command, with the duration within the parenthesis.
__________________
Talk is based on the assumption that you can get somewhere if you keep putting one word after another
Deathwalker is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On