The c32rtomb() is a built-in function in C/C++ which converts 32 bit character representation to a narrow multibyte character representation. It is defined within the uchar.h header file of C++.
size_t c32rtomb(char* s, char32_t c32, mbstate_t* p)
Parameters: The function accepts three mandatory parameters as shown below:
- s: specifies the string where the multibyte character is to be stored.
- c16: specifies the 32 bit character to convert.
- p: specifies the pointer to an mbstate_t object used when interpreting the multibyte string.
Return Value: The function returns two values as shown below:
- On success of the program, the function returns the number of bytes written to the character array pointed to by s.
- If failed, then -1 is returned and EILSEQ is stored in err no.
Note: There is no output in the above program since it is a case of failure.
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- arc function in C
- log() function in C++
- exp() function C++
- fma() function in C++
- iswspace() function in C/C++
- array get() function in C++ STL
- array at() function in C++ STL
- wcsncat() function in C/C++
- transform_inclusive_scan() function in C++
- iswctype() function in C/C++
- iswxdigit() function in C/C++
- towlower() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.