12

在 Visual C++ 2008 Express 中,当我创建一个新的控制台项目时,我会从以下程序开始:

//Explodey.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

int _tmain(int argc,_TCHAR* argv[])
{
  return 0;
}

我有几个问题:

  • 为什么main函数是_tmain而不是main?

  • 我认为argv参数应该是char* argv[]而不是_TCHAR.

  • 是什么stdafx.h

这真的不像我习惯的 C++。

4

1 回答 1

3

在这里查看 _tmain... 等。

C++ 中的 _tmain() 和 main() 有什么区别?

stdafx.h 是 Windows 应用程序的预编译头文件(可选)。更多在这里:

http://en.wikipedia.org/wiki/Precompiled_header

于 2012-05-04T15:15:34.233 回答