C Library Function - strxfrm()
Description
C Library Function **size_t strxfrm(char dest, const char src, size_t n) transforms the string according to LC_COLLATE in the program's current locale settings src 's first n characters and places them in the string dest it.
Declaration
Below is the declaration of the strxfrm() function.
size_t strxfrm(char *dest, const char *src, size_t n)
Parameters
- dest -- A pointer to the destination array where the content is stored; if the argument n is 0, it is a null pointer.
- src -- The C string to be transformed according to the current locale.
- n -- The maximum number of characters to be copied to str1.
Return Value
This function returns the length of the transformed string, not including the null-terminating character.
Example
The following example demonstrates the use of the strxfrm() function.
#include
#include
int main()
{
char dest[20];
char src[20];
int len;
strcpy(src, "W3C School");
len = strxfrm(dest, src, 20);
printf("字符串 |%s| 的长度是: |%d|", dest, len);
return(0);
}
Let's compile and run the above program, which will produce the following result:
字符串 |W3C School| 的长度是: |10|
C Standard Library -