In Visual C++ 2008 Express, when I create a new console project I get the following program to start with:
//Explodey.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc,_TCHAR* argv[])
{
return 0;
}
I have a few questions about it:
-
Why is the main function _tmain instead of main?
-
I’d thought the
argvparameter was supposed to bechar* argv[]instead of_TCHAR. -
What’s
stdafx.h?
This doesn’t really feel like the same C++ I’m used to.
Take a look here for _tmain… etc.
What is the difference between _tmain() and main() in C++?
stdafx.h is a precompiled header (optional) for Windows applications. More here:
http://en.wikipedia.org/wiki/Precompiled_header