我需要让代码同时支持宽字符和窄字符,所以需要控制L的使用
1 #define WIDESTRPREFIX L
2 std::wstring aa = L"ABC";
3 std::wstring bb = WIDESTRPREFIX"ABC";
这段代码会提示这样的错误
第三行: 3 error C2065: 'L' : undeclared identifier
PHP中文网2017-04-17 13:27:13
I don’t know why your code doesn’t work, I just know that this way of writing is fine
#define WIDESTRPREFIX(a) L##a
std::wstring bb = WIDESTRPREFIX("ABC");
I don’t quite understand the purpose of this. Maybe I can use a template?