Wcscoll() Function in C++In this article, we will discuss the wcscoll() function in C++ with its syntax and example. The C++ wcscoll() function compares two strings that are null-terminated. A comparison is made based on the current locale that is specified by the LC_COLLATE category. This function compares the initial character of every string. Until the characters diverge or a null wide character that indicates the end of a string is encountered, they are regarded as equal. Syntax:It has the following syntax: Two required parameters are accepted by the function and are explained as follows: wcs1: It is a pointer to the wide strings with null terminations that need to be compared. wcs2: The null terminated wide strings to compare are pointed to by this pointer. Value returned: The function yields the following three values:
Example 1:Let's take an example to illustrate the use of wcscoll() function in C++: Output: In American English: apple precedes banana In Swedish: apple precedes banana Example 2:Let's take another example to illustrate the use of wcscoll() function in C++: Output: In Czech: javatpoint precedes JTP In American English: javatpoint precedes JTP
Next Topicwcsncpy() function in C++
|