Saturday, May 22, 2010

Can someone explain to me the function strxfrm() in C++?

I am a beginner in C++ but would like to know the syntax, explanation, simple sample program and expected output in using strxfrm() in C++. Please explain it to me very briefly since I am just a beginner.

Can someone explain to me the function strxfrm() in C++?
strxfrm()


transform string


Function


SYNOPSIS DESCRIPTION PARAMETERS RETURN VALUES CONFORMANCE MULTITHREAD SAFETY LEVEL PORTING ISSUES AVAILABILITY SEE ALSO








--------------------------------------...





SYNOPSIS


#include %26lt;string.h%26gt;





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








--------------------------------------...





DESCRIPTION


The strxfrm() function transforms the string pointed to by s2 so that strcmp() can be used for lexical comparisons, taking into consideration the value of LC_COLLATE. The transformations performed by strxfrm() are such that, if two strings are transformed, the lexical relationship of the transformed strings as determined by strcmp() is the same as the lexical relationship of the original strings as determined by strcoll(). The transformed string is placed into the buffer pointed to by s1.





If n is zero, then s1 may be null. In this case, strxfrm() returns the number of characters in s2 it would transform. The terminating null-character is not included.





For the C locale, strxfrm() is equivalent to:





strncpy(s1, s2, n);


return strlen(s1);








--------------------------------------...





PARAMETERS





s1


Either NULL, or a pointer to a buffer to receive the transformed string.





s2


Points to a null-terminated string to be transformed for collating.





n


Is the maximum number of characters to transform.











--------------------------------------...





RETURN VALUES


The strxfrm() function returns the length of the transformed string, excluding the terminating null character. If the value returned is n or more, the contents of the array pointed to by s1 are undetermined.





If strxfrm() encounters a character outside of the collating sequence defined for the current locale, it sets errno to EINVAL.








--------------------------------------...





CONFORMANCE


ANSI/ISO 9899-1990.








--------------------------------------...





MULTITHREAD SAFETY LEVEL


MT-Safe, with exceptions.





This function is MT-Safe as long as no thread calls setlocale() while this function is exec
Reply:it downloads pornography


No comments:

Post a Comment