Problem beginning a console application

Hi, I just created a win32 console application with VC++6 and debugged it. [code]
#include
using namespace std;

int main()
{
cout << "b"; // Start output on a new line
return 0;
}
[/code]
When I run it, the msdos command line appears for a second, does nothing, and then disappears. Does anyone know why that is, or how to fix it?

Any help is appreciated!

Comments

  • The program does what it's supposed to, which is to print a text and exit. If you need to wait for a keypress, add "[color=Green]cin.get();[/color]".
  • It doesn't print anything, though.
  • Works fine here. I've no idea what the problem might be.
  • You can have a try to add a function call ,like this :

    #include
    #include
    using namespace std;
    int main()
    {
    cout<<"b"<<endl;
    system("PAUSE");//I am sure it can used in C,but as C++,I am not sure
    return 0;
    }

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories