加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

了解Visual C控制台项目中的_tmain

发布时间:2020-12-16 07:53:51 所属栏目:百科 来源:网络整理
导读:在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函数
在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?

这真的不像我习惯的一样.

解决方法

看看这里_tmain …等

What is the difference between _tmain() and main() in C++?

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读