Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-27-2007, 08:09 PM   #1
In Runtime
 
Join Date: Nov 2006
Posts: 161
Default system pause (quick)

so im starting to learn c++, and im on my first tutorial (hello world)

and then when i compile and run it the dos thing will just go up for a split second

i know the way to fix this is to insert a line of code that contains the word "system" and "pause" and some symbols at the end, but i forgot which symbols/ what order you put them in.
__________________

browserjoe is offline   Reply With Quote
Old 04-30-2007, 12:49 PM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: system pause (quick)

it is just system(pause);

but that's not strictly true...

your program works fine, it starts it runs, it terminates.


try using the command prompt to run your program. that way the console will stay open so that you can actually see it say hello world.
__________________

__________________
I didnít fight my way to the top of the food chain to be a vegetarianÖ
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 04-30-2007, 01:53 PM   #3
Fully Optimized
 
UK31337's Avatar
 
Join Date: Feb 2005
Posts: 2,776
Default Re: system pause (quick)

Isn't system(pause); a partially-Windows specific function call? When I compiled that on gcc on the Mac it flagged up a warning.
__________________
Master of common sense. If you don't like it, stop reading.
UK31337 is offline   Reply With Quote
Old 04-30-2007, 02:19 PM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: system pause (quick)

system();

is non-specific it's the C syntax for making a call that is to a system procedure or program,

so system('notepad.exe'); starts notepad. (on windows)

pause is specific to windows,
might be available on Linux, not sure.
__________________
I didnít fight my way to the top of the food chain to be a vegetarianÖ
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 05-02-2007, 08:58 PM   #5
Fully Optimized
 
–88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to –88
Default Re: system pause (quick)

Quote:
Originally Posted by root View Post
pause is specific to windows,
might be available on Linux, not sure.
there is a pause function for C. I'm not sure if it is available for C++
__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine LŲsung!
–88 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off



All times are GMT -5. The time now is 10:55 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0