Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Library Function - strxfrm()

C Library Function - strxfrm()

C Standard Library - <string.h> C Standard Library -

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

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 - <string.h> C Standard Library -