In the _tmain c () and main () difference

Source Reference: https: //www.cnblogs.com/lucyjiayou/archive/2011/05/07/2039621.html

tchar.h> can be found, such as #define the _tmain main , so to add #i nclude <tchar.h> can be used.
3. Therefore _tmain after compile is still the main , it can perform
addition, wmain also the main other aliases, to support two-byte language environment

//

/* Program */
#define _tmain main

#define _tWinMain WinMain

#ifdef _POSIX_

#define about _tenviron

#else

#define _tenviron _environ

#endif

#define __targv __argv _tmain defined in tchar.H file is just a macro.

//

1) main function name is a standard entry c / c ++ in 2) winmain entry function is a program form windows api (int winapi winmain () is in winapi __stdcall macro definitions in the windows.h) 3) _tmain _twinmain is unicode to compile-time version of the function the alias string code can be automatically converted ************************************** ********************************************

**********************************************************************************

1.main C is a function of the program, _tmain is the main support for Unicode main alias used

Defined 2._tmain can be found at <tchar.h>, such as #define _tmain main, so to add #include <tchar.h> can be used. _tmain () is a macro, if it is UNICODE then he is wmain () or he is main ()
3. Therefore _tmain after compile is still main, you can execute ************** ************************************************** ******************

**********************************************************************************

1) main () is WINDOWS console program (32BIT) or DOS program (16BIT), 2) WinMain () is WINDOWS GUI program, wmain () is a UNICODE version of main (), 3) _tmain () is a macro If it is UNICODE he is wmain () or he is main (), another alias wmain is the main, to support two-byte language environment

 

Guess you like

Origin www.cnblogs.com/MCSFX/p/11298453.html
Recommended