C ++ wctrans () - standardní knihovna C ++

Funkce wctrans () v C ++ vrací hodnotu typu wctrans_t, která odpovídá transformaci.

Funkce wctrans () je definována v hlavičkovém souboru.

prototyp wctrans ()

 wctrans_t wctrans (const char * str);

Funkce wctrans () převezme řetězec C jako argument a vrátí hodnotu typu wctrans_t, která se používá pro mapování širokého znaku.

Parametry wctrans ()

  • str: Řetězec C specifikující požadovanou transformaci.

wctrans () Návratová hodnota

  • Funkce wctrans () vrací objekt wctrans_t, který lze použít s towctrans () pro mapování širokých znaků.
  • Pokud str neposkytuje mapování podporované aktuálním národním prostředím C, vrátí nulu.

Příklad: Jak funguje funkce 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

Zajímavé články...