I've done Hello World programs with Visual C++ Express 2010 before, but I always checked the "Empty Project" option. This time I selected a Console project and took the defaults. Program is below.
// HelloWorld.cpp : Defines the entry point for the console application.
//
using namespace std;
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Hello World\n";
return 0;
}
Errors are..
- Error : Name must be a namespace name (refers to "std" on line 4)
- error C2065: 'cout' : undeclared identifier
#2 is pretty obvious given number 1. I'm pretty new to Visual Studio 2010 except for Empty console projects. Figure I'd check it out. The whole "tmain" and "stdafx.h" aspect is new to me, but I figured I'd try it out. Do I need to configure something to make it find namespace std?