I want to know the reason why there are macros such as T, TEXT, _TEXT, __TEXT or __T when they all ultimately do the same thing.
i.e.
mapping "string" to L"string" if UNICODE is defined.
Thanks for the answers. On a more practical approach, can somebody explain me the behavior of the code given below?
#include <stdio.h>
#include <conio.h>
#include <tchar.h> // For _T and _TEXT
#include <windows.h> // For __TEXT
int __cdecl main ()
{
printf ("%s", _TEXT(__FILE__ )); // Works fine
printf ("%s", _T(__FILE__)); // Works fine
printf ("%s", __TEXT(__FILE__ )); // error C2065: 'L__FILE__': undeclared identifier
_getwch();
}
Update:
I think my code has something to do with C preprocessor tokenization. I am posting a separate question for that. Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…