Funkcia wctrans () v C ++ vracia hodnotu typu wctrans_t, ktorá zodpovedá transformácii.
Funkcia wctrans () je definovaná v hlavičkovom súbore.
prototyp wctrans ()
wctrans_t wctrans (const char * str);
Funkcia wctrans () vezme ako svoj argument reťazec C a vráti hodnotu typu wctrans_t, ktorá sa používa na mapovanie širokého znaku.
Parametre wctrans ()
- str: C reťazec špecifikujúci požadovanú transformáciu.
wctrans () Vrátená hodnota
- Funkcia wctrans () vracia objekt wctrans_t, ktorý je možné použiť s towctrans () na mapovanie širokých znakov.
- Ak str neposkytuje mapovanie podporované aktuálnym miestnym jazykom C, vráti nulu.
Príklad: Ako funguje funkcia wctrans ()?
#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