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

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile