putwchar
From cppreference.net
File input/output
| Types and objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definido en el encabezado
<wchar.h>
|
||
|
wint_t putwchar
(
wchar_t
ch
)
;
|
(desde C95) | |
Escribe un carácter ancho
ch
en
stdout
.
Contenidos |
Parámetros
| ch | - | carácter ancho a escribir |
Valor de retorno
ch en caso de éxito, WEOF en caso de fallo.
Ejemplo
Ejecutar este código
#include <locale.h> #include <stdio.h> #include <stdlib.h> #include <wchar.h> int main() { setlocale(LC_ALL, "en_US.utf8"); const wchar_t data[] = { L'\u2200', // Unicode name: "FOR ALL" L'∀', L'\n', }; for (size_t t = 0; t != (sizeof data / sizeof(wchar_t)); ++t) { if (putwchar(data[t]) == WEOF) { puts("I/O error in putwchar"); return EXIT_FAILURE; } } return EXIT_SUCCESS; }
Salida posible:
∀∀
Referencias
- Estándar C23 (ISO/IEC 9899:2024):
-
- 7.31.3.9 La función putwchar (p: TBD)
- Estándar C17 (ISO/IEC 9899:2018):
-
- 7.29.3.9 La función putwchar (p: 310)
- Estándar C11 (ISO/IEC 9899:2011):
-
- 7.29.3.9 La función putwchar (p: 425)
- Estándar C99 (ISO/IEC 9899:1999):
-
- 7.24.3.9 La función putwchar (p: 370)
Véase también
|
escribe un carácter en
stdout
(función) |
|
|
(C95)
|
escribe un carácter ancho en un flujo de archivo
(función) |
|
Documentación de C++
para
putwchar
|
|