Function strxfrm () in C
The function size_t strxfrm (char * dest, const char * src, size_t n) transforms the first n characters of the src string into the current locale and places them in dest string.
Declaring the function strxfrm () in C
Here is the declaration for strxfrm () in C:
size_t strxfrm ( char * dest , const char * src , size_t n )
Parameters
dest - This is the pointer to the destination array, where the content is to be copied. It can be a null pointer if the parameter for n is 0.
src - This is the string to be converted into the current Locale.
n - The maximum number of characters to be copied to str1.
Returns the value
This function returns the length of the converted string, not including the ending null character.
For example
The following C program illustrates the usage of strxfrm () in C:
#include #include int main () { char dest [ 20 ]; char src [ 20 ]; int len ; strcpy ( src , "QTM Team" ); len = strxfrm ( dest , src , 20 ); printf ( "Do dai cua chuoi |%s| la: |%d|" , dest , len ); return ( 0 ); }
Compile and run C program to see the result.
According to Tutorialspoint
Previous article: Function strtok () in C
You should read it
- Memset () function in C
- The strrchr () function in C
- Strcpy () function in C
- Memmove function in C
- The strcoll () function in C
- The function strcmp () in C
- The function strncmp () in C
- The strstr () function in C
- The function strpbrk () in C
- The strtok () function in C
- Strcat function in C
- The strlen () function in C