Guys i am learning c++ and i have problem, the book i use to learn is c++ all in one for dummies 2nd edition, it uses code blocks and for the first program it gives a code in the console application as,
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, I am your computer talking." << endl;
cout << 5 + 10 << end1;
return 0;
}
When i type in the same code in vs 2012, it shows a error that #include "stdafx.h" is missing.
The VS2012 project you're working on apparently has precompiled headers enabled, you can turn these off in your project's settings as they will be of little use to you right now.
It's looking for a precompiled header which is something used to improve compile times. However, if you're just starting out you can ignore using a precompiled header. When you create a new C++ project when it shows you the a dialog that contains an "Application settings" page you can disable precompiled headers by unclicking the checkbox. Or after creating the project go to project properties and under C/C++ there should be "Precompiled headers" page. Go switch the "Precompiled header" setting to "Not Using Precompiled Headers".