Share via


What is the difference between _T and L?

Question

Wednesday, February 6, 2008 12:56 AM

What is the difference between _T("some string") and L"some string"?

All replies (1)

Wednesday, February 6, 2008 1:00 AM âś…Answered | 1 vote

_T("Text") is a narrow-character (ASCII) literal in an ANSI build but a wide character (UNICODE) literal in a Unicode build.

 

L"Text" is always a wide-character literal, regardless of preprocessor definitions.

 

_T() is a macro, the L prefix is part of the core C and C++ language lexical structure.