What does the "T" represents in a string. For example _T("Hello").I have seen this in projects where unicode support is needed.What it actually tells the processor
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
_T
stands for “text”. It will turn your literal into a Unicode wide character literal if and only if you are compiling your sources with Unicode support. See http://msdn.microsoft.com/en-us/library/c426s321.aspx.From MSDN:
It's actually used for projects where Unicode and ANSI support is required. It tells the compiler to compile the string literal as either Unicode or ANSI depending on the value of a precompiler define.
Why you would want to do this is another matter. If you want to support Unicode by itself then just write Unicode, in this case
L"Hello"
. The_T()
macro was added when you needed to support Windows NT and later (which support Unicode) and Windows 9x/ME (which do not). These days any code using these macros is obsolete, since all modern Windows versions are Unicode-based.