C ++ btowc () - C ++ Standardbibliotek

Funktionen btowc () i C ++ konverterar ett tecken till dess motsvarande tecken.

Funktionen btowc () definieras i rubrikfilen.

btowc () prototyp

 wint_t btowc (int c);

Funktionen btowc () tar ett enda byte-tecken c som argument och returnerar dess breda teckenekvivalent.

btowc () Parametrar

  • c: Teckenet med en enda byte för att konvertera till brett tecken.

btowc () Returvärde

Funktionen btowc () returnerar den breda karaktärsrepresentationen av c om c är ett giltigt enda byte-tecken. Om c är EOF returneras WEOF.

Exempel: Hur fungerar btowc () -funktionen?

 #include #include #include using namespace std; int main() ( char str() = "Helloxf4xdf"; wchar_t wc; int count = 0; for (int i=0; i 

When you run the program, the output will be:

 5 out of 7 characters were successfully widened

Intressanta artiklar...