C strxfrm() Function

Last Updated:

C strxfrm()

The strxfrm() function transforms the first n characters of source string into current locale and place them in destination string.


C Compiler
#include <stdio.h> #include <string.h> int main() { char src[] = "123456789"; char dest[10]; long len; len = strxfrm(dest, src, 7); printf("strxfrm returns (len): %ld\n", len); printf("dest: %s", dest); return 0; }


size_t strxfrm(char *str1, const char *str2, size_t n);

Parameter Values

dest Required Specifies the destination array where the content is to be copied.
src Required Specifies the source array where the string to be transformed into current locale.
n Required Specifies the maximum number of characters to be copied to dest.

Return Value

Number Returns the length of the transformed string, not including the terminating null-character.

Share this Page

Meet the Author