Next Previous Contents

## 3.161 strxfrm

> Function

>   Transform a string.

> Header

>   `string.h`

> Declaration

>   `size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t n);`

> Description

>   The `strxfrm` function transforms the string pointed to by s2 and places the resulting string into the string pointed to by s1. The transformation is such that if the `strcmp` function is applied to two transformed strings, it returns a value greater than, equal to, or less than zero, corresponding to the result of the `strcoll` function applied to the same two original strings. No more than n characters are placed into the resulting array pointed to by s1, including the terminating null character.

> Limits

>   - `s1` and `s2` must not point to the same memory area, otherwise the behaviour is undefined.
>   - If `n` is zero, `s1` may be a NULL pointer.
>   - The function is only available as fastcall function, so it may only be used in presence of a prototype.
>   - Since cc65 doesn't support different charcter sets, `strxfrm` will just copy s2 to s1 using `strncpy`.
> Availability

>   ISO 9899

> See also

>   strcmp, strcoll, strncpy,

> Example

>   None.

Next Previous Contents