User Tools

Site Tools


c:string.h:strxfrm
click
to support this page (eg 0,42 € or so) Thanks.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:string.h:strxfrm [2012/07/16 22:41]
127.0.0.1 external edit
c:string.h:strxfrm [2013/02/17 03:02] (current)
Daniel Gohlke
Line 1: Line 1:
-        size_t strxfrm(char *str1, const char *str2, size_t n);+         
 +{{keywords>wiki library source code example reference}} 
 +====== strxfrm ====== 
 + 
 +<code c> 
 +#include <stdlib.h> 
 +size_t strxfrm(char *str1, const char *str2, size_t n); 
 +</code> 
 + 
 +===== description of strxfrm ===== 
 +The function strxfrm () transforms a null-terminated C string according to local settings. Thus the string can be safely compared using strcmp () with another. The transformed string is stored in a new string. 
 + 
 +=====  strxfrm C Sourcecode Example ===== 
 +<code c> 
 +/*  
 + * strxfrm example code 
 + * http://code-reference.com/c/string.h/strxfrm 
 + */ 
 +#include <stdio.h> 
 +#include <string.h> 
 +#include <stdlib.h> 
 + 
 +int main(void) 
 + { 
 +    char *target, *dst, *source; 
 +    int length; 
 +         
 +    source  = "the answer: life the universe & everything"; 
 +    dst = (char *) calloc(80, sizeof(char)); 
 +    length = strxfrm(target, source, 80); 
 +    printf("%s has the length %d\n", target, length); 
 +    return 0; 
 +
 +</code> 
 + 
 +==== output of strxfrm c example ==== 
 +    the answer: life the universe & everything has the length 42
advertising
c/string.h/strxfrm.txt · Last modified: 2013/02/17 03:02 by Daniel Gohlke

Impressum