c++ - VS2015 现在错误 C4477 "fprintf"

标签 c++ visual-studio-2015

到目前为止,VS 完美地编译了我的代码,但现在 VS2015 向我显示了一个我无法理解的警告。

我的代码:

 CString nombre=_T("Stack"), dsc=_T("overflow");
  _ftprintf(file, _T("%s %s);\n"), nombre, m_dsc);

和 VS2015:

Warning C4477 'fwprintf' : format string '%s' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'CString'

为什么?,为什么我不能使用 CString 而不是 wchart_t?。我想使用 CString

提前致谢

约瑟米

最佳答案

_ftprintf(file, _T("%s %s);\n"), (LPCTSTR)nombre, (LPCTSTR)dsc);

关于c++ - VS2015 现在错误 C4477 "fprintf",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32481128/

相关文章:

sqlite - 如何使用 ClickOnce 发布带有 SQLite 的 Winforms 应用程序

ms-word - 从 VSTO 加载项检测 Word 2016 中的文本更改

git - Visual Studio 2015 git 显示所有分支

c++ - 为单个线程强制执行语句的相对顺序

c++ - 在 C++ 中推断 lambda 的模板类型

c# - 如何旋转二维整数数组

c++ - Natvis 用于可编译为 dll 或 lib 的类型

c++ - const char * constexpr 在编译时和运行时求值

c++ - 同时测试 n 个元素的 vector 的所有元素

c++ - 如何辨别网络流量