
January 8th, 2003, 09:12 PM
|
|
Offensive Member
|
|
Join Date: Oct 2002
Location: in the perfect world
|
|
the program runs and finishes so it exits.
try pausing the program before the return 0 (if this works in your compiler)
sleep(5000);//in milliseconds so five seconds
Better, try putting a while loop and setting up a condition (value ) that the user can enter to leave the program
Code:
do
{
cout<<"Please input your age (enter zero to exit): ";
cin>>age;
//chack to see if the user tried to exit
if(0 != age)
{
//all your code here
}
}while(0 != age)
__________________
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.
Frank Zappa
|