主函数 main WinMain _tmain _tWinMain 的区别
From: http://blog.csdn.net/zhangxinrun/article/details/5781451
main是C/C++的標(biāo)準(zhǔn)入口函數(shù)名
WinMain是windows API窗體程序的入口函數(shù)。(int WINAPI WinMain()) 中 WINAPI是__stdcall宏,在windef.h中定義的。
_tmain _tWinMain 是Unicode版本函數(shù)別名,對應(yīng)與wmain和wWinMain。
*****************************************************************************************
<tchar.h>中有如下幾行:
#ifdef _UNICODE
#define _tmain????? wmain
#define _tWinMain?? wWinMain
#else?? /* ndef _UNICODE */
#define _tmain????? main
#define _tWinMain?? WinMain
#endif
這樣定義是為了自動適應(yīng)是否定義了UNICODE,其中wmain和wWinMain是支持UNICODE字符的。
前綴為"_t"的應(yīng)用與UNICODE的函數(shù),工程中最好用這類函數(shù)。
總結(jié)
以上是生活随笔為你收集整理的主函数 main WinMain _tmain _tWinMain 的区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: etcd v3 集群——简单配置
- 下一篇: C语言中的位域的使用