std::fputws
Defined in header <cwchar> | ? | ? |
---|---|---|
int fputws( const wchar_t* str, std::FILE* stream ); | ? | ? |
´ÓÒÔ¿Õ½áβµÄ¿í×Ö·û´®Ð´Èëÿ¸ö¿í×Ö·û¡£str
µ½Êä³öÁ÷stream
£¬ºÃÏñͨ¹ý·´¸´Ö´ÐÐstd::fputwc
...
ÖÕÖ¹¿Õ¿í×Ö·ûµÄstr
²»ÊÇдµÄ¡£
²ÎÊý
str | - | null-terminated wide string to be written |
---|---|---|
stream | - | output stream |
·µ»ØÖµ
Ôڳɹ¦Ê±£¬·µ»ØÒ»¸ö·Ç¸ºÖµ.
ʧ°Üʱ£¬·µ»ØEOF
²¢ÉèÖÃÎó²îÖ¸±ê%28¼ûstd::ferror
29%stream
...
Àý
¶þ´Î
#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
}
¶þ´Î
²ú³ö£º
¶þ´Î
ÓùÐݤߤʤµ¤¤
¶þ´Î
Áí¼û
fputs | writes a character string to a file stream (function) |
---|---|
wprintffwprintfswprintf | prints formatted wide character output to stdout, a file stream or a buffer (function) |
fputws | writes a wide string to a file stream (function) |
fgetws | gets a wide string from a file stream (function) |
c fputwsÎĵµ
? cppreference.com
ÔÚCreativeCommonsAttributionÏÂÊÚȨ-ShareAlikeδÒÆÖ²Ðí¿Év3.0¡£
±¾ÎĵµÏµÌÚѶÔÆ¿ª·¢ÕßÉçÇø³ÉÔ±¹²Í¬Î¬»¤£¬ÈçÓÐÎÊÌâÇëÁªÏµ cloudcommunity@tencent.com