How to stop the DOS window disappear after finishing my program?

This is a discussion on How to stop the DOS window disappear after finishing my program? within the C Programming forums, part of the General Programming Boards category; Hi all I am in new in C/C++. Here is my question. I created a workspace in VC++ 6.0 using ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    12

    How to stop the DOS window disappear after finishing my program?

    Hi all

    I am in new in C/C++. Here is my question.

    I created a workspace in VC++ 6.0 using Win32 Console Application. However, the result in DOS window was disappeared so quickly when the program is finished. I have no time to read whether the result is correct or not. I just want to check it right or not, so I don't want to write it in a file.

    I would be grateful if anyone can help.

    David

  2. #2
    Registered User
    Join Date
    Dec 2002
    Posts
    103

    Try This

    Hi

    At the end of your program .. simply display this message
    Code:
    int main()
    {
        ......... your program....
    
       printf("Exiting the program.... press the enter key");
       getchar();
    
        return 0;
    }
    Have a wonderful day.... and keep smiling... you look terrific that way
    signing off...
    shiv... as i know him

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    12
    Thank you very much. (I am smiling. )

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    It's also in the FAQ!
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 07:14 AM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 01:39 PM
  3. opengl help
    By heat511 in forum Game Programming
    Replies: 4
    Last Post: 04-05-2004, 01:08 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 12:42 PM

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