C examples for string.h:strxfrm
function
<cstring> <string.h>
Transforms C string source using the current locale and copies the first num characters of the transformed string to destination, returning its length.
size_t strxfrm ( char * destination, const char * source, size_t num );
Parameter | Description |
---|---|
destination | Pointer to the destination array where the content is to be copied. |
source | C string to be transformed. |
num | Maximum number of characters to be copied to destination. |
The length of the transformed string.
#include <stdio.h> #include <string.h> int main ()/*from w w w. ja v a 2s . com*/ { char str[] ="- This, a sample string."; char des[80]; size_t i = strxfrm(des,str,30); printf ("%d\n", i); printf ("%s\n", des); return 0; }