De functie wctrans () in C ++ retourneert een waarde van het type wctrans_t die overeenkomt met de transformatie.
De functie wctrans () is gedefinieerd in het header-bestand.
wctrans () prototype
wctrans_t wctrans (const char * str);
De functie wctrans () neemt een C-string als argument en retourneert een waarde van het type wctrans_t die wordt gebruikt voor het toewijzen van een breed teken.
wctrans () Parameters
- str: C-string die de gewenste transformatie specificeert.
wctrans () Retourwaarde
- De functie wctrans () retourneert een object wctrans_t dat kan worden gebruikt met towctrans () voor het toewijzen van brede tekens.
- Als str geen afbeelding biedt die wordt ondersteund door de huidige C-landinstelling, retourneert het nul.
Voorbeeld: hoe werkt de functie 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