what is iswlower ()?
iswlower()
is a function provided by the C and C++ standard libraries for working with wide characters (wchar_t), which are capable of representing a broader range of characters than the regular char type. Specifically, iswlower()
is used to determine whether a wide character is a lowercase letter.
#include <cwctype> int iswlower(wint_t wc);
iswlower()
takes a single argumentwc
, which is a wide character (wchar_t
or a compatible type).-
- It returns a non-zero value if
wc
is a lowercase letter (a-z in the ASCII character set or equivalent in other character sets supported by wide characters). Otherwise, it returns zero.
Here’s a simple example demonstrating the usage of
iswlower()
: - It returns a non-zero value if
#include <iostream> #include <cwctype> int main() { // Define a wide character 'a' wchar_t ch = L'a'; // Check if the character is a lowercase letter if (iswlower(ch)) { std::wcout << L"The character '" << ch << L"' is a lowercase letter." << std::endl; } else { std::wcout << L"The character '" << ch << L"' is not a lowercase letter." << std::endl; } return 0; }
In this example, we use iswlower()
to determine whether the wide character ‘a’ is a lowercase letter. If it is, we print a message indicating that it’s a lowercase letter; otherwise, we print a message indicating that it’s not.
OutputĀ of theĀ code :
The character 'a' is a lowercase letter. === Code Execution Successful ===