im having trouble running my console app with the following format.I've looked through dozens of websites and stack overflow questions and non of them were useful.please help me figure this out:
#include "stdafx.h"
#include <iostream
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
}
cannot open source file "stdafx.h"
identifier "_TCHAR" is undefine.
it's a console project and it does'nt create those stdafx.h and stdafx.cpp files.
Replace
_TCHARwithchar, and_tmainwithmain._TCHARis not part of the C++ language, it's an obsolete feature of the Windows API that should not be used today.You can also remove
#include "stdafx.h", it's a common convention when using the Microsoft Visual Studio compiler but it's not required. You may also need to turn off the precompiled headers option in your project.