(转) main(), _tmain(), wmain(), wWinMain(), _tWinMain()的区别

2021-02-15 09:16

阅读:505

A special function named main is the starting point of execution for all C and C++ programs. If you are writing code that adheres to the Unicode programming model, you can use wmain, which is the wide-character version of main.

在所有C和C++程序中,以一个叫main的特殊函数作为应用程序的入口点,如果你希望在程序中使用Unicode 编码,那么你可以使用wmain,这是main函数的宽字符版本。

You can also use _tmain, which is defined in TCHAR.h. _tmain resolves to main unless _UNICODE is defined. In that case, _tmain resolves to wmain.

同时,我们可以使用_tmain,它在TCHAR.h头文件中定义,如果没有定义_UNICODE,那么_tmain会转换成mian,否则会被转换成wmain。


评论


亲,登录后才可以留言!