A pointer to a wide-character string, where each element is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets.
1st Parameter
Pointer to the destination buffer where the transformed wide-character string will be stored.
2nd Parameter Type : const wchar_t *
A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
2nd Parameter
Pointer to the null-terminated wide-character string to be transformed.
3rd Parameter Type : size_t
Platform-specific unsigned type for array indices and memory sizes.
3rd Parameter
The maximum number of wide characters to write to `dest`, including the null terminator.
Read more about parameters of wcsxfrm in parameters section
The wcsxfrmfunction in C language Transforms a wide character string such that the result of wcscmp on these transformed strings is the same as wcscoll on the original strings.
wcsxfrm transforms the wide-character string pointed to by src and places the result into the array pointed to by dest. The transformation is such that if wcscmp is applied to two transformed strings, it returns the same result as wcscoll applied to the original strings. No more than n wide characters are placed into the resulting array pointed to by dest, including the terminating null wide character.
The wcsxfrmfunction takes 3
parameters:
•
wchar_t * `dest`: Pointer to the destination buffer where the transformed wide-character string will be stored.
•
const wchar_t * `src`: Pointer to the null-terminated wide-character string to be transformed.
•
size_t `n`: The maximum number of wide characters to write to `dest`, including the null terminator.
Transforms the wide-character string `src` into a form suitable for locale-specific collation and stores it in `dest`. Writes at most `n` wide characters, including the null terminator. Returns the length of the transformed string (excluding the null terminator). If the return value is greater than or equal to `n`, the destination buffer is too small, and the output is truncated.
The wcsxfrm function return value :
Returns the length of the transformed wide string (not including the terminating null wide character)
If the value returned is n or more, the contents of dest are indeterminate
Output
This example demonstrates the basic usage of wcsxfrm to transform a wide character string.