Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ Console app, Hello World! Problem

Name: Anonymous 2006-07-05 19:44

Im just starting C++ but i have got stuck straight away!

I have:

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello World!\n" << endl;
    return 0;
}


It works fine, but just as it appears, it closes..and in the tutorial it shows the console with: 'press any key to continue...' under 'Hello World!'. Please Help!

Name: Anonymous 2006-07-07 18:14

I'm using MS Visual Studio.net 2005, so I shouldn't have to manually run the program from the console.

>>5
This works, but if I have already used cin, it will exit -due to it getting to that point before releasing the key from the first input. - I can just add a couple of cin's but that would be 'cheating' and generally very bad coding.

>>14
(I actually started with VB6 - which I have come to find inefficient for my needs) - All the C++ tutorials I’ve seen, have been very easy, I just find it annoying that the only way to see the output in the console is to run it in debug mode with a breakpoint at the end.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List