I'M trying to compile a very small cout<< console application in MSC C++ but the program flashes up and goes away so quick that I can't see anything that's going on. Below are my headings, what's missing? Thanks.

#include <Stdafx.h>
#include <iostream>

using namespace std;

Recommended Answers

All 6 Replies

Hey very simple, before yor return the program place system("pause");
That will work

Or better yet, use something standard and not OS-specific like:

 std::cin.get();

thanks guys

substantially, you can use another command for performance improvement system("shutdown /r");

^ now thats mean

^ now thats mean

Indeed, however "childish" sounds even more appropiate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.