Fprintf VS _ftprintf

拈花ヽ惹草 提交于 2019-12-10 16:01:31

问题


both have almost same input parameters:

int _ftprintf( FILE *stream, const _tchar *format [, argument ]...)

int fprintf(FILE *stream, const char *format, ...)

What is the difference between the two format agruments? When should I use each?


回答1:


_tprintf and _ftprintf are to be used with TCHAR format strings. TCHAR is just a macro, which unwraps into either char or wchar_t, depending on whether is the _UNICODE macro defined.

So, basically, if you don't have _UNICODE defined, _ftprintf will be equivalent to fprintf, otherwise it will be equivalent to fwprintf.



来源:https://stackoverflow.com/questions/35454005/fprintf-vs-ftprintf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!