very new to C++

This is a discussion on very new to C++ within the C++ Programming forums, part of the General Programming Boards category; I have started doing some of the online tutorials and the question I have is . When I compile those ...

  1. #1
    Necro-TEK
    Guest

    Arrow very new to C++

    I have started doing some of the online tutorials and the question I have is . When I compile those simple beginner programs it brings a dos box up does what the program says to do the closes almost as quick as it opens . What gives with that ?
    I dont even get to see what it did .

  2. #2
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    1)you can add getch(); at the bottom of your program. now your program wil wait untill you press a key. (note: you have to put #include <conio.h> at the top of your file)

    2)you can add system("pause"); at the end of your program ( #include <stdlib.h> )

    3)if you are using MSVC++ you can use run (CTRL-F5)

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    yes

    Yes, but for msvc++, it is _getch(); . You must have the underscore. Also, when you start making longer programs, it won't happen, at least thats how it went for me.

  4. #4
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    getch() works for me, I've never used _getch()
    doesn't the '_' has something to do with unicode?

  5. #5
    Nero-TEK
    Guest

    Thumbs up

    Thnakyou very much

  6. #6
    Unregistered
    Guest
    If you press enter to submit some imformation does that cont for the getch()

  7. #7
    Registered User Generator's Avatar
    Join Date
    Aug 2001
    Posts
    238
    >>When I compile those simple beginner programs it brings a dos box up <<

    It shouldn't bring up a DOS box what your actually seeing is a Win32 console.
    What's a matter you no like peppi?

Popular pages Recent additions subscribe to a feed

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