Forcing a program to stay open.

This is a discussion on Forcing a program to stay open. within the C++ Programming forums, part of the General Programming Boards category; I've tried using cin.get() to stop the program from closing itmediatley and it will work, if I'm only displaying text. ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    6

    Forcing a program to stay open.

    I've tried using cin.get() to stop the program from closing itmediatley and it will work, if I'm only displaying text. But when I use a program where the user can input (cin >>) it will close after the user inputs the data. From these forums I found sysem("pause") which solved everything... but I don't like the message it gives (Press any key to continue...).
    Thanks in advance,

    anyomous

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    cin.ignore(80, '\n');
    cin.get();

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    6
    thanks it worked

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. program not staing open
    By Unlockitall in forum C++ Programming
    Replies: 6
    Last Post: 07-11-2007, 09:39 AM
  2. Open a new program from a C++ application
    By axr0284 in forum C++ Programming
    Replies: 9
    Last Post: 12-29-2004, 12:29 PM
  3. drawing over the open program.
    By Unregistered in forum Windows Programming
    Replies: 6
    Last Post: 01-23-2002, 03:37 PM
  4. get program to open a html file
    By task in forum C Programming
    Replies: 14
    Last Post: 11-09-2001, 12:20 PM

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