The c/c++ library strxfrm() transform the characters of source string into current locale and place them in destination string.
For that LC_COLLATE category is used which is defined in locale.h . strxfrm() function performs transformation in such a way that result of strcmp on two strings is the same as result of strcoll on two original strings.
size_t strxfrm(char *str1, const char *str2, size_t num); parameters: str1 :is the string which receives num characters of transformed string. str2 : is the string which is to be transformed num :is the maximum number of characters which to be copied into str1.
Input : 'geeksforgeeks' Output : 13
Length of string geeksforgeeks is: 13
Example 2 :
Input : 'hello geeksforgeeks' Output : 20 // in this example it count space also
Length of string hello geeksforgeeks is: 20
Example 3 :
19 Hell Hello geeksforgeeks
This article is contributed by Shivani Baghel . If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between cout and puts() in C++ with Examples
- Difference between forward list and list in C++
- Short-Circuiting in C++ and Linux
- Different types of range-based for loop iterators in C++
- Learn C++ Programming Step by Step - A 20 Day Curriculum!
- Why do we need reference variables if we have pointers
- Similarities and Difference between Java and C++
- Macros and its types in C/C++
- Reversed Range-based for loop in C++ with Examples
- How to find index of a given element in a Vector in C++
- Introduction to Complex Objects and Composition
- NULL undeclared error in C/C++ and how to resolve it
- std::remove_const in C++ with Examples
- Finding Median of unsorted Array in linear time using C++ STL