Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015 now error C4477 "fprintf"

Until now, VS compile my code perfectly, but now VS2015 show me a warning that I can't to understand.

My code:

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

and VS2015:

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

Why?, Why can't I use CString instead of wchart_t?. I want to use CString

Many thanks in advance

Josemi

like image 972
Josemi Avatar asked Mar 01 '26 01:03

Josemi


1 Answers

_ftprintf(file, _T("%s %s);\n"), (LPCTSTR)nombre, (LPCTSTR)dsc);
like image 128
i486 Avatar answered Mar 03 '26 16:03

i486



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!