std:: fputws
From cppreference.net
C++
Input/output library
| I/O manipulators | ||||
| Print functions (C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(C++20)
|
||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
| Synchronized Output | ||||
|
(C++20)
|
||||
| Types | ||||
| Error category interface | ||||
|
(C++11)
|
||||
|
(C++11)
|
C-style I/O
| Types and objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定义于头文件
<cwchar>
|
||
|
int
fputws
(
const
wchar_t
*
str,
std::
FILE
*
stream
)
;
|
||
将空终止宽字符串
str
中的每个宽字符写入输出流
stream
,其效果类似于重复执行
std::fputwc
。
来自
str
的终止空宽字符不会被写入。
目录 |
参数
| str | - | 要写入的空终止宽字符串 |
| stream | - | 输出流 |
返回值
成功时,返回非负值
失败时,返回
EOF
并在
stream
上设置错误指示器(参见
std::ferror
)。
示例
运行此代码
#include <clocale> #include <cstdio> #include <cwchar> int main() { std::setlocale(LC_ALL, "en_US.utf8"); int rc = std::fputws(L"御休みなさい", stdout); if (rc == EOF) std::perror("fputws()"); // POSIX requires that errno is set }
可能的输出:
御休みなさい
参阅
|
将字符串写入文件流
(函数) |
|
|
将格式化宽字符输出打印到
stdout
、文件流或缓冲区
(函数) |
|
|
fputws
|
将宽字符串写入文件流
(函数) |
|
从文件流获取宽字符串
(函数) |
|
|
C 文档
for
fputws
|
|