exiting

This is a discussion on exiting within the C++ Programming forums, part of the General Programming Boards category; well, i need some help with this. how would i be able to make it so when they press the ...

  1. #1
    Registered User MOH123's Avatar
    Join Date
    Aug 2005
    Posts
    20

    exiting

    well, i need some help with this. how would i be able to make it so when they press the quit option it closes? like this:

    Code:
    1) blah
    2) blah
    3) quit
    //i know this stuff
    
    if (a == 3) {
          //what do i put here to close?
    }
    -thanks in advance
    Games by Me:
    Using C++:
    Text Adventure game - No Name [||||||||||] - =0% -
    -----------------------------------------------
    Using RPG Maker 2000 and 2003:
    - No Games as of now -

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    If that code is in the main function, just return an int.

    Code:
    return 0;

  3. #3
    Registered User MOH123's Avatar
    Join Date
    Aug 2005
    Posts
    20
    ah, hehe. thanks
    Games by Me:
    Using C++:
    Text Adventure game - No Name [||||||||||] - =0% -
    -----------------------------------------------
    Using RPG Maker 2000 and 2003:
    - No Games as of now -

  4. #4
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    MOH123, you have got to be a noob to the noobs.
    The question you just asked and Dante Shamest just answered can be found in chapter one of like, all the C++ books and tutorials out there!

  5. #5
    Registered User MOH123's Avatar
    Join Date
    Aug 2005
    Posts
    20
    yea, i dont have any books and i just didn't look at the tutorials. i looked in the help file but couldn't find it there either. I'll look harder next time :P
    Games by Me:
    Using C++:
    Text Adventure game - No Name [||||||||||] - =0% -
    -----------------------------------------------
    Using RPG Maker 2000 and 2003:
    - No Games as of now -

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. simple crash problem (exiting func)
    By te5la in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2008, 04:15 PM
  2. Exiting the program.
    By Taka in forum C Programming
    Replies: 6
    Last Post: 10-14-2007, 10:24 AM
  3. Exiting windows through a C program.
    By Afro in forum C Programming
    Replies: 3
    Last Post: 06-23-2007, 09:29 AM
  4. Ask user to save file before exiting.
    By Bajanine in forum Windows Programming
    Replies: 3
    Last Post: 11-15-2004, 06:34 PM
  5. prevent exiting
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 12-12-2001, 02:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21