DOS Program Question

This is a discussion on DOS Program Question within the C++ Programming forums, part of the General Programming Boards category; I'm new to programming with C++... Anyways, Windows seems to close the DOS executable whenever I choose to Compile & ...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    3

    Question DOS Program Question

    I'm new to programming with C++...

    Anyways, Windows seems to close the DOS executable whenever I choose to Compile & Run my program. It apears for like a few seconds and quickly closes it, anyone know how to disable that?

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Oke,You're programming in wich IDE?,Wich enviroment?,Wich
    type of program?

  3. #3
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    run your program from a console window.
    hello, internet!

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    3
    How would I do that on Dev-C++?

  5. #5
    Registered User
    Join Date
    Jun 2002
    Posts
    230
    Im using dev c++ and getch() works. Heres an example.

    Code:
    #include <iostream>
    #include <conio.h> // for getch()
    
    int main ()
    {
      cout << "crap";
      
      getch(); // waits for user to press any key
      return 0;
    }
    C++ Rules!!!!
    ------------
    Microsoft Visual Studio .NET Enterprise

  6. #6
    Registered User Pioneer's Avatar
    Join Date
    Dec 2002
    Posts
    59
    Code:
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    
    main(){
        printf("Do stuff\n");
        getch();
        /*or*/
        system("pause");
    }

  7. #7
    Registered User
    Join Date
    Dec 2002
    Posts
    3

    Thanks

    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Random Question Assign Program
    By mikeprogram in forum C++ Programming
    Replies: 6
    Last Post: 11-17-2005, 10:04 PM
  2. Replies: 26
    Last Post: 06-15-2005, 03:38 PM
  3. program design question
    By theroguechemist in forum C++ Programming
    Replies: 4
    Last Post: 03-02-2004, 08:45 PM
  4. insufficient memory for tsr
    By manmohan in forum C Programming
    Replies: 8
    Last Post: 01-02-2004, 09:48 AM
  5. How to Use DOS Ccommands in a C++ Program?
    By mike01324 in forum C++ Programming
    Replies: 2
    Last Post: 02-24-2003, 11:04 PM

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