当前位置: 代码迷 >> 综合 >> “atof”: 不能将参数 1 从“CString”转换为“const char *”
  详细解决方案

“atof”: 不能将参数 1 从“CString”转换为“const char *”

热度:16   发布时间:2023-12-22 13:19:35.0

问题描述:m_Data[number]=atof(strtemp);
其中,m_Data为double型,number为long型,strtemp为CString型的。
为什么会出现这样的错误?
error C2664: “atof”: 不能将参数 1 从“CString”转换为“const char *”

解决:用_ttof代替atof 或 _wtof(str);

  相关解决方案