C strxfrm() Function

You are Here:

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

Output

strxfrm returns (len): 9 dest: 1234567

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.

Reminder

Hi Developers, we almost covered 98% of String functions and Interview Question on C with examples for quick and easy learning.

We are working to cover every Single Concept in C.

Please do google search for:

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