本文介绍了Fprintf VS _ftprintf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者的输入参数几乎相同:

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?

推荐答案

_tprintf_ftprintfTCHAR格式字符串一起使用. TCHAR只是一个宏,根据是否定义了_UNICODE宏,它会自动展开为charwchar_t.

_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.

因此,基本上,如果您未定义_UNICODE,则_ftprintf将等同于fprintf,否则将等同于fwprintf.

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

这篇关于Fprintf VS _ftprintf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 12:53