Results 1 to 3 of 3

Thread: Return?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    In a box next to WalMart.
    Posts
    13

    Question 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..."

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    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;} 
    Baaaaaaaaah

  3. #3
    jim mcnamara
    Guest
    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
  •  



Click Here to Expand Forum to Full Width