Funkcia towctrans () v C ++ transformuje daný široký znak podľa zadanej transformácie.
Funkcia towctrans () je definovaná v hlavičkovom súbore.
towctrans () prototyp
wint_t towctrans (wint_t wc, wctype_t desc);
Funkcia towctrans () aplikuje transformáciu na široký znak wc určený desc.
towctrans () parametre
- wc: Široký charakter, ktorý sa má transformovať.
- desc: Transformácia, ktorá sa získa z hovoru na wctrans ().
towctrans () Vrátená hodnota
- Funkcia towctrans () vráti nenulovú hodnotu, ak má wc vlastnosť zadanú desc, inak vráti nulu.
Príklad: Ako funguje funkcia 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