std::wctob
De cppreference.com
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
Definido en el archivo de encabezado <cwchar>
|
||
int wctob( std::wint_t c ); |
||
Narrows
c
un carácter ancho si su equivalente de caracteres multibyte en el estado inicial de cambios es una solo byte .Original:
Narrows a wide character
c
if its multibyte character equivalent in the initial shift state is a single byte.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Suele ser posible que los caracteres del juego de caracteres ASCII, ya que la mayoría de las codificaciones multibyte (como UTF-8) utilizar bytes individuales para codificar los caracteres .
Original:
This is typically possible for the characters from the ASCII character set, since most multibyte encodings (such as UTF-8) use single bytes to encode those characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Contenido |
[editar] Parámetros
c | - | carácter ancho a estrecharse
Original: wide character to narrow The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Valor de retorno
EOF
c
si no representa un carácter multibyte con 1 longitud en estado inicial de cambios .Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
De lo contrario, la representación de un byte de
c
como unsigned char convertido a intOriginal:
Otherwise, the single-byte representation of
c
as unsigned char converted to intThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Ejemplo
Ejecuta este código
#include <cwchar> #include <cstdio> #include <clocale> int main() { std::setlocale(LC_ALL, ""); std::printf("narrow: %c\nnarrowed from wide: %c\n", 'a', std::wctob(L'a')); }
Salida:
narrow: a narrowed from wide: a
[editar] Ver también
ensancha un carácter estrecho de un solo byte a caracteres anchos, si es posible Original: widens a single-byte narrow character to wide character, if possible The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
[virtual] |
convierte un carácter o caracteres de charT a char Original: converts a character or characters from charT to char The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro virtual protegida de std::ctype )
|
Documentación de C para wctob
|