How does the TEXT(“x”) macro expand to L”x” if unicode is defined and “x” if unicode is not defined because when I try to compile the following code it says “error #1049: Syntax error in macro parameters.”
#define T("x") "x"
int main()
{
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Lookup the
tchar.hheader in your installation. You’d get something like the following:In Unicode mode, the above macro pastes an
Land a string argument together. In ASCII mode, there is no prefix to paste so it goes simply as:Note that you invoke this macro indirectly, via another macro —
_T()(with a single underscore) and pass a string literal as argument.