Thread: User-input not working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    system("PAUSE") has several drawbacks, and does not offer any advantage over the other solutions.

    Since this is the C++ forums, we'll be assuming Serejai is using C++ He should use this method, as suggested by the FAQ.
    Code:
    #include <iostream> 
     
    int main(void)
    {
    std::cout <<"Press [Enter] to continue" <<std::endl;
    std::cin.get();
    return(0);
    }
    Apoc's method also works, but it is more for the C audience.

    edit: And to add my personal opinion, it is better to have the cursor immediately in front of the prompt. That's the way most console apps do it.
    Last edited by sean; 08-22-2004 at 05:26 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to limit user input to a certain number of digits?
    By NewbGuy in forum C Programming
    Replies: 7
    Last Post: 05-08-2009, 09:57 PM
  2. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 02:20 PM
  3. newbie question regarding user input
    By cantore in forum C Programming
    Replies: 4
    Last Post: 03-05-2006, 08:57 PM
  4. comparing user input
    By lambs4 in forum C Programming
    Replies: 5
    Last Post: 12-15-2002, 10:28 AM