std::wctob
Aus cppreference.com
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <cwchar> | ||
int wctob(std::wint_t c ); | ||
Narrows eine breite Charakter
c
wenn seine Multibyte-Zeichen entspricht in der ersten Schaltzustand ist ein Single-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.
Dieser ist in der Regel für die Zeichen aus dem ASCII-Zeichensatz möglich, da die meisten Multibyte-Kodierungen (wie UTF-8) verwenden einzelnen Bytes, um diese Zeichen zu kodieren .
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.
Inhaltsverzeichnis |
[Bearbeiten]Parameter
c | - | Breitzeichen einzuengen 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. |
[Bearbeiten]Rückgabewert
EOF wenn
c
stellen keine Multibyte-Zeichen mit einer Länge 1 in ersten Schaltzustand .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.
Andernfalls wird die Single-Byte-Darstellung
c
als unsignedchar um intOriginal:
Otherwise, the single-byte representation of
c
as unsignedchar 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.
[Bearbeiten]Beispiel
#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'));}
Output:
narrow: a narrowed from wide: a
[Bearbeiten]Siehe auch
weitet sich ein Single-Byte engen Charakter-Zeichen, wenn möglich 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. (Funktion) | |
[virtuell] | wandelt ein Zeichen oder Zeichen aus charT um 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. (virtuellen geschützten Member-Funktion of std::ctype ) |
C documentation for wctob |