RE: [Dev-C++] DEV-C++ Does Not Pause
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Santiago P. C. <San...@yd...> - 2002-10-10 16:20:59
|
Hi again,
You can use 'cin.ignore();' instead of 'system("pause");'.
This is a portable method also.
Regards,
Santy
PS: Maybe a C++ pedantic issue, but for C++ include style use '#include
<iostream>' instead of '#include <iostream.h>' ;o)
-----Original Message-----
From: Administrator [mailto:ad_...@ho...]
Sent: jueves, 10 de octubre de 2002 16:29
To: Dev...@li...
Subject: [Dev-C++] DEV-C++ Does Not Pause
//start of code
#include <iostream.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
--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. No confidentiality
or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it and kindly
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. Opinions, conclusions and
other information in this message that do not relate to the official business of
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it.
--------------------------------------------------------------------------------------
|