#C 语言标准库函数 wprintf
#include <wchar.h>
int wprintf(const wchar_t *restrict format, ...);
说明
按格式向标准输出写出数据。
应使用宽定向或未定向的文件流。
按照格式说明提供参数,转换以当前 locale 的相应规则为准。
自 C95 起提供。
参数
format- 以空字符结束的格式串,包含普通字符和转换指令。...- 随转换指令提供的输出值。
返回值
- 正常返回实际写出宽字符数,排除终止符。输出或编码错误时返回负值。
#示例
#include <wchar.h>
int main(void)
{
int count = wprintf(L"item %d\n", 42);
return count != 8;
}