在VS2013上运行一个简单程序时,出现了error C4996: 'swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter. To use traditional Microsoft swprintf, set _CRT_NON_CONFORMING_SWPRINTFS.的错误。由错误信息可以知道swprintf函数的问题,在MSDN上查询得到该函数的申明

int swprintf(
   wchar_t *buffer,
   size_t count,
   const wchar_t *format [,
   argument]...
);

且有下面这段话:

 

修改为:swprintf(szTip, 100,_T("计时:%d"), i);

即添加了count参数后就正确了。

相关文章:

  • 2021-12-13
  • 2022-03-03
  • 2021-10-18
  • 2022-12-23
  • 2021-09-07
  • 2021-05-14
  • 2021-07-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-07-27
  • 2021-06-21
  • 2021-08-31
相关资源
相似解决方案