C ++ towctrans () - Bibliothèque standard C ++

La fonction towctrans () en C ++ transforme un caractère large donné selon une transformation spécifiée.

La fonction towctrans () est définie dans le fichier d'en-tête.

prototype towctrans ()

 wint_t towctrans (wint_t wc, wctype_t desc);

La fonction towctrans () applique une transformation au caractère large wc spécifié par desc.

Paramètres towctrans ()

  • wc: Le caractère large à transformer.
  • desc: La transformation obtenue à partir d'un appel à wctrans ().

towctrans () Valeur de retour

  • La fonction towctrans () renvoie une valeur différente de zéro si wc a la propriété spécifiée par desc, sinon renvoie zéro.

Exemple: Comment fonctionne la fonction towctrans ()?

 #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

Articles intéressants...