Thread: quick question

  1. #1

    quick question

    I have a quick question.
    how can I make a program stop and then start running again by pressing a key. something like 'readkey' and so to resume. I want to use this so the user on my program can read the text displayed before it is cleared by the system ("CLS").

    thx in advance.

  2. #2
    char ch;
    cin >> ch;

    in the above sequence the program will pause indefinitely as long as the input buffer is empty at the time the line cin >> ch; is encountered and will resume as soon as any key is entered.

    if your compiler has the conio header file, then you can use the kbhit() function as an alternate mechanism.

  3. #3
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    system ("pause"); i think it uses the same header as for the cls one
    Email: || AIM: MisterSako || MSN:

    -the shroom has spoken

  4. #4
    thx. the system ("paused") was what I wanted.

  5. #5
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002

    must be in

    It must be in one of these:


    But how do we get to check which function is in which ?

  6. #6
    Registered User Unreg1stered's Avatar
    Join Date
    Jul 2002
    It's in stdlib.h .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick Question
    By Necrofear in forum Tech Board
    Replies: 9
    Last Post: 12-04-2005, 09:14 AM
  2. Very quick math question
    By jverkoey in forum A Brief History of
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  3. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM