The
cout error might be because you aren't taking the namespace issues into account. You need to make sure that in some way you tell the compiler that you are using the
cout stream that's a part of the
std namespace. There are 3 ways this is typically done:
#1
#include <iostream>
...
std::cout << ...
#2
#include <iostream>
using std::cout;
...
cout << ...
#3
#include <iostream>
using namespace std;
...
cout << ...
The first method is generally preferred by the more experienced coders and the last one used most often in smaller projects and by beginners.
As for the stdafx thing, what type of project are you creating - Win32 Application/Win32 Console Application/etc...? I'm personally of the opinion that dealing with pre-compiled headers is mostly a pain-in-the-$#@. Whenever I create a project, whatever type it is, I always select "empty project" from the wizard. Choosing other options always seems to force you to have that stdafx piece in there.