|
-
Jun 26th, 2002, 11:56 PM
#1
Thread Starter
New Member
Return?
What would I return to keep a program open? I've tried everything from 0 to 1, to even 300! Please help =/
(Yes, I'm a newbie programmer [at least in C++])
Word to the wise:
The image reads:
"Too often we lose sight of life's simple pleasures. Remember, when someone annoys you it takes 42 muscles in your face to frown, BUT, it only takes 4 muscles to extend your arm and *****-slap that mother@%?&! upside the head."
"Pass it on..."
-
Jun 27th, 2002, 02:26 AM
#2
PowerPoster
If you are using Visual C++ then you can declare a variable and then get the input into it at the end like this:
PHP Code:
int main(){
int i;
//Do stuff....
cin>>i;
return 0;}
-
Jun 27th, 2002, 09:17 AM
#3
Once you execute the return statment in main(), you exit the current program.
By convention returning 0 means success. The calling program recevies the return value and keeps on going (or aborts on error)
But what you seem to want is a way for the program not to quit?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|