std:: fputwc
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>
|
||
|
std::
wint_t
fputwc
(
wchar_t
ch,
std::
FILE
*
stream
)
;
|
(1) | |
|
std::
wint_t
putwc
(
wchar_t
ch,
std::
FILE
*
stream
)
;
|
(2) | |
주어진 출력 스트림 stream 에 와이드 문자 ch 를 기록합니다.
2)
매크로로 구현될 수 있으며
stream
을 여러 번 평가할 수 있습니다.
목차 |
매개변수
| ch | - | 기록할 와이드 문자 |
| stream | - | 출력 스트림 |
반환값
ch 성공 시, WEOF 실패 시. 인코딩 오류가 발생하면, errno 가 EILSEQ 로 설정됩니다.
예제
이 코드 실행
#include <cerrno> #include <clocale> #include <cstdio> #include <cstdlib> #include <cwchar> #include <initializer_list> int main() { std::setlocale(LC_ALL, "en_US.utf8"); for (const wchar_t ch : { L'\u2200', // Unicode name: "FOR ALL" L'\n', L'∀', }) { if (errno = 0; std::fputwc(ch, stdout) == WEOF) { std::puts(errno == EILSEQ ? "Encoding error in fputwc" : "I/O error in fputwc" ); return EXIT_FAILURE; } } return EXIT_SUCCESS; }
가능한 출력:
∀ ∀
참고 항목
|
파일 스트림에 문자를 기록합니다
(함수) |
|
|
파일 스트림에 와이드 문자열을 기록합니다
(함수) |
|
|
파일 스트림에서 와이드 문자를 가져옵니다
(함수) |
|
|
C 문서
for
fputwc
|
|