Thread: how to get the file not to shud down right away

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    14

    how to get the file not to shud down right away

    I've got a problem. Unless I add a line of text to pause( wich doesn't even always work) My program always immediately shuds down after it's done what it's got to do, leaving me no time to read it or even in some cases to type something in. How can I change this?

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Maybe add a cin.get(); statement or two at the end of the program?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    14
    nope, doesn't work.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    14
    already checked those and since I don't know how to navigate my way trough dos and my pause command doesn't always work, I posted it here.

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    14
    It's pretty much all the code and I'm using bloodshed.

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    14
    On another subject could you help me scoop the bugs out of this code?
    Code:
    #include <iostream.h>
    using namespace std;
    
    int main()
    int answer;
    {
     cout<<"You are sitting in your seat comfortably and looking through the airplane window. You know you're going to enjoy your vacation greatly. Suddenly the stewardess comes in and asks: 'Does anyone here know how to defuse a bomb?' Wich of the following answers do you choose?"<<endl;
     cout<<"2.Yes"<<endl;
     cout<<"1.No"<<endl;
     cin>>answer;
    {
     if (answer==1)
     {
      cout<<"Nobody answers and soon terror starts to spread trough amongst the passagers. GAME OVER"<<endl; 
      for(int x=1000;x>0;x--)
      {
       cout<<x<<endl;
      }
      cout<<"BAM CRASH BURN DEATH HORROR";
      return 0;
     }
    }
    Btw, I know I haven't added the code for if its chioce yes but I want to get the bugs out of this first

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  2. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM