例如:
// This will become either SomeMethodA or SomeMethodW,
// depending on whether _UNICODE is defined.
SomeMethod( _T( "My String Literal" ) );
// Becomes either AnotherMethodA or AnotherMethodW.
AnotherMethod( _TEXT( "My Text" ) );
Run Code Online (Sandbox Code Playgroud)
我见过两者.为了清楚起见,_T似乎是为了简洁和_TEXT.这只是一个主观的程序员偏好还是比技术更具技术性?例如,如果我使用一个而不是另一个,我的代码是否会针对特定系统或某些旧版本的头文件进行编译?