The famous pain for VC++ learning is the cout using VC++. In other compilers cout only requires iostream.h header but unfortunately this does not work for VC++.
VC++ requires another statement using namespace std;
See the complete Hello word below.
#include “stdafx.h”
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << “Hello world”;
return 0;
}
Hi, beside using namespace std, we can use std::cout to solve the problem too.
#include “stdafx.h”
#include
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << “Hello world”;
return 0;
}