Re: [Dev-C++] DEV-C++ Does Not Pause
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Santiago <sa...@ho...> - 2002-10-11 00:05:44
|
just type cin.ignore(); below the cin>>age; statement Check this link for more info: http://www.gunn.palo-alto.ca.us/~jkleinjans/ignore.html ----- Original Message ----- From: "Rafael Charnovscki" <cha...@un...> To: "Administrator" <ad_...@ho...> Cc: "Dev-Cpp List" <dev...@li...> Sent: Thursday, October 10, 2002 10:58 AM Subject: Re: [Dev-C++] DEV-C++ Does Not Pause > 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 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |