I have been doing TC++ programing for the last 2 years.. This evening all of a sudden I made the switch to vc++.. here is the code.. my first ever Visual C++ programme.. it is compiling without errors but the console window poped and disappeared quickly.. what is wrong? something similar to getch() missing or what?

// test2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
	cout<< "Hello world";
	return 0;
}

Recommended Answers

All 2 Replies

Put in a cin.get(); in between lines 9 and 10. It's along the same lines but it's also nice and standard.

Also, you did not start the program by defining a console program.

_tmain() and stdafx.h are not standard and supplied by VC because of the type of program you told it to create.

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.