Funkcija wctrans () u C ++ vraća vrijednost tipa wctrans_t koja odgovara transformaciji.
Funkcija wctrans () definirana je u zaglavnoj datoteci.
prototip wctrans ()
wctrans_t wctrans (const char * str);
Funkcija wctrans () uzima C argument kao argument i vraća vrijednost tipa wctrans_t koja se koristi za mapiranje širokog znaka.
wctrans () parametri
- str: C niz koji specificira željenu transformaciju.
wctrans () Povratna vrijednost
- Funkcija wctrans () vraća objekt wctrans_t koji se može koristiti s towctrans () za mapiranje širokih znakova.
- Ako str ne pruži mapiranje podržano trenutnom C lokacijom, vraća nulu.
Primjer: Kako funkcionira funkcija 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