Manually programming Press any key in vis C++

This is a discussion on Manually programming Press any key in vis C++ within the C++ Programming forums, part of the General Programming Boards category; Hi all, Thanks for looking at my question, it's a pretty basic one. In MS Vis C++, i think the ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    1

    Manually programming Press any key in vis C++

    Hi all,

    Thanks for looking at my question, it's a pretty basic one.

    In MS Vis C++, i think the compiler automatically tacks on a "Press any key to continue..." For the user to end the program.

    Im just wondering how you can manually do it? How to write it yourself in the program?

    Thank you so much!

    -vance-

  2. #2
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    Code:
    #include <iostream>
    #include <stdlib>
    
    using namespace std;
    
    int main()
    {
        cout << "This is the end..." << endl;
        system("pause")  //<-- this is the one
        
        return 0;
    }
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

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