Thread: new to c++ programming

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    6

    new to c++ programming

    hello i am new to c++ i have made a very simple program, i took a class in college but i got frustrated with c++ and i dropped the class well anyways i bought a book and would like to give c++ antoher try and i was wonding about one thing, last night i wrote this simple program and when i go to run the program it all works fine i am using borland C++ 5.0 i want to write the words hello world on the screen i run the program and a small black box appears real fast with the words in it but it disappears i want to be able to keep the box on the screen with out it disappering how would i do that here is my code my teacher in college told me a way but i forgot it

    #include <iostream.h>

    int main()
    {
    cout << " Hello world!"<< endl;

    return 0 ;
    }

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Code:
    #include <iostream.h> 
    #include <conio.h>
    int main() 
    { 
    cout << " Hello world!"<< endl; 
    getch();
    return 0 ; 
    }
    A lot of people do something like this. Its a bit gawky. Personally I prefer to run the programs within a dos console........

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    6

    thanks fordy

    thanks for the help

Popular pages Recent additions subscribe to a feed