Towctrans () -funktionen i C ++ förvandlar en given bred karaktär enligt en specifik transformation.
Funktionen towctrans () definieras i rubrikfilen.
towctrans () prototyp
wint_t towctrans (wint_t wc, wctype_t desc);
Funktionen towctrans () tillämpar en omvandling till det breda tecknet wc som anges av beskrivning.
towctrans () Parametrar
- wc: Den breda karaktären som ska förvandlas.
- desc: Transformationen som erhålls från ett samtal till wctrans ().
towctrans () Returvärde
- Funktionen towctrans () returnerar ett värde som inte är noll om wc har den egenskap som anges av desc, annars returnerar noll.
Exempel: Hur funktionen towctrans () fungerar?
#include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L"Ŝŵitĉhiňģ Ćăse"; wcout << L"Before transformation" << endl; wcout << str << endl; for(int i=0; i
When you run the program, the output will be:
Before transformation Ŝŵitĉhiňģ Ćăse After transformation ŝŴITĈHIŇĢ ćĂSE