• 0

C++6.0 and XP


Question

ok im new to C++ but when i try to run a small program i made the program executes aand closes automaticly, is that a thing with XP or a problem with my program? it runs fine from inside of the programming environment but not outside

here is the code:

// TrialRun.cpp
// Our First program
#include <iostream>

using namespace std;

int main()
{
 ?cout << "Some people think programming windows"
 ? ?<< endl
 ? ?<< "is like nailing jello to the ceieling..."
 ? ?<< endl
 ? ?<< "easy with the right nails."
 ? ?<< endl << endl;
 ?return 0;
}

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
its suposed to just sit there till i press enter, then close

584734629[/snapback]

Not without getchar()

When your application teminates, there's no reason to leave it on the desktop.

Your IDE might force it to stay until u hit a key because it's good for debugging; mine doesn't do that (VS .NET 2003).

Link to comment
Share on other sites

  • 0

That's normal behavior. When you run a DOS based app, it closes the window when it exits. However, if you open a command prompt (cmd.exe) and launch the app from there, the window will stay open after the app exits.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.