C ++ towctrans () - Libreria standard C ++

La funzione towctrans () in C ++ trasforma un dato carattere largo secondo una trasformazione specificata.

La funzione towctrans () è definita nel file di intestazione.

prototipo di towctrans ()

 wint_t towctrans (wint_t wc, wctype_t desc);

La funzione towctrans () applica una trasformazione al carattere largo wc specificato da desc.

Towctrans () Parametri

  • wc: L'ampio personaggio da trasformare.
  • desc: la trasformazione ottenuta da una chiamata a wctrans ().

Towctrans () Restituisce il valore

  • La funzione towctrans () restituisce un valore diverso da zero se wc ha la proprietà specificata da desc, altrimenti restituisce zero.

Esempio: come funziona la funzione 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

Articoli interessanti...