C strxfrm()

« Previous Chapter Next Function »


The strxfrm() function transforms the string pointed to by str2 so that it can be used by the strcmp() function and puts the result into the string pointed to by str1. After the transformation, the outcome of a strcmp() using str1 and a strcoll() using the original string pointed to by str2 will be the same. Not more than count characters are written to the array pointed to by str1.

The strxfrm() function returns the length of the transformed string.

strxfrm() Syntax

Following is the syntax of the strxfrm() function :

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

strxfrm() Example

Following line transforms the first 10 characters of the string pointed to by s2 and puts the result in the string pointed to by s1.

strxfrm(s1, s2, 10);

C Online Test

« Previous Chapter Next Function »

© Copyright 2021. All Rights Reserved.