I am working on the \'driver\' part of my programing assignment and i keep getting this absurd error:
error C2065: \'cout\' : undeclared identifier
In Visual Studio you must #include "stdafx.h" and be the first include of the cpp file. For instance:
These will not work.
#include
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
#include
#include "stdafx.h"
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
This will do.
#include "stdafx.h"
#include
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
Here is a great answer on what the stdafx.h header does.