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.
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
Maybe you are interested
Revealing new findings about the size of the galaxy Admire incredibly detailed images of the Orion Nebula through the eyes of the James Webb telescope This star 'tears up' its companion to create a rare beautiful nebula Galaxy merger moment gives glimpse into Milky Way's future Science has discovered the fastest-flying star in the Milky Way, reaching 8% of the speed of light Discovered organic molecules that can make life in the center of the Milky Way