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++])
Printable View
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++])
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;}
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?