Funkce towctrans () v C ++ transformuje daný široký znak podle zadané transformace.
Funkce towctrans () je definována v hlavičkovém souboru.
towctrans () prototyp
wint_t towctrans (wint_t wc, wctype_t desc);
Funkce towctrans () použije transformaci na široký znak wc určený desc.
towctrans () parametry
- wc: Široký znak, který se má transformovat.
- desc: Transformace, která je získána z volání wctrans ().
towctrans () Vrátit hodnotu
- Funkce towctrans () vrací nenulovou hodnotu, pokud wc má vlastnost určenou desc, jinak vrací nulu.
Příklad: Jak funguje funkce 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