看这个网址解决的:https://blog.csdn.net/weixin_34023982/article/details/87380020

可以利用W2A函数将将_TCHAR *转换为char *,举例:

#include "stdafx.h"
#include <stdlib.h>
#include <atlconv.h>  //需要加入的 1

int _tmain(int argc, _TCHAR* argv[])
{
_TCHAR * tchBuffer = L"12345";

USES_CONVERSION; //这两句也要加入2
char *szBuffer = W2A(tchBuffer);//这两句也要加入3

int nNumber = atoi(szBuffer);

printf("nNumber:%d", nNumber);

return 0;
}

找到自己程序报错的地方,将上面三句加入即可运行

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
猜你喜欢
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
相关资源
相似解决方案