C strxfrm() Function

C strxfrm() Function

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

Example

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; }

Syntax

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

Parameter Values

ValueTypeExplanation
destRequiredSpecifies the destination array where the content is to be copied.
srcRequiredSpecifies the source array where the string to be transformed into current locale.
nRequiredSpecifies the maximum number of characters to be copied to dest.

Return Value

ValueExplanation
NumberReturns the length of the transformed string, not including the terminating null-character.

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author