Re: [Dev-C++] DEV-C++ Does Not Pause
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Rafael C. <cha...@un...> - 2002-10-10 15:00:43
|
Hi,
You probably have a compilation error.
system("PAUSE") needs stdlib.h (#include <stdlib.h>)
Rafael
cha...@un...
Administrator wrote:
> //start of code
>
> #include <iostream.h>
//include stdlib
#include <stdlib.h>
>
> int main() //Most important part of the program!
>
> {
>
> int age; //Need a variable...
>
> cout<<"Please input your age: "; //Asks for age
>
> cin>>age; //The input is put in age
>
> if(age<100) //If the age is less than 100
>
> {
>
> cout<<"You are pretty young!"; //Just to show it works
>
> }
>
> else if(age==100) //I use else just to show an example
>
> {
>
> cout<<"You are old"; //Just to show you it works...
>
> }
>
> else
>
> {
>
> cout<<"You are really old"; //Executed if no other statement is executed
>
>
> }
>
> return 0;
>
> }
> //end of code
>
> when I enter "my age" then I must press <ENTER> to run the if
> statements, The DOS window stays up till i press <ENTER> to process.
>
> I cant get the movie to pause and give me the result "You are old". "You
> are really old" or whatever the result must be.
>
> How can I pause the movie and process it?
>
> I tried:
>
> //code
> system("PAUSE");
> return 0;
> }
> //code
>
> but this just trows an error.
>
> Also I tried to run the EXE by itself, but again, it does the same thing
>
> Thanks for your help
|