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
Discover more
learn C programming things to know about programming C parameters in C run the command in CShare by
Isabella HumphreyYou should read it
- Strcpy () function in C
- Memmove function in C
- The strcoll () function in C
- The function strcmp () in C
- The function strncmp () in C
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- The function printf () in C
- time.h in C
- The function getenv () in C