当你在项目属性中,常规设置在字符集为UNICODE后,运行以下代码:

#include "stdafx.h"

#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

#if defined UNICODE
 std::cout << sizeof(L"aaa") <<endl;
#endif
 return 0;
}

 会发现UNICODE无效,此时,在项目配置属性-》C/C++-》预处理器-》预处理器定义中,点选编辑选择从“父项或项目默认属性继承”即可。

相关文章:

  • 2022-12-23
  • 2021-09-17
  • 2022-01-03
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案