iswlower()是C /C++中的內置函數,該函數檢查給定的寬字符是否為小寫字符。它在C++的cwctype頭文件中定義。
用法:
int iswlower(ch)
參數:該函數接受單個強製性參數ch,該參數指定寬字符,我們必須檢查該字符是否為小寫字符。
返回值:該函數返回兩個值,如下所示。
- 如果參數ch是小寫字符,則返回非零值。
- 如果不是小寫字符,則返回0。
以下示例程序旨在說明上述函數。
程序1:
// C++ program to illustrate
// iswlower() function
#include <cwctype>
#include <iostream>
using namespace std;
int main()
{
wchar_t ch1 = 'a';
wchar_t ch2 = 'A';
// Function to check if the character
// is a lowercase character or not
if (iswlower(ch1))
wcout << ch1 << " is a lowercase character ";
else
wcout << ch1 << " is not a lowercase character ";
wcout << endl;
if (iswlower(ch2))
wcout << ch2 << " is a lowercase character ";
else
wcout << ch2 << " is not a lowercase character ";
return 0;
}
輸出:
a is a lowercase character A is not a lowercase character
程序2:
// C++ program to illustrate
// iswlower() function
#include <cwctype>
#include <iostream>
using namespace std;
int main()
{
wchar_t ch1 = 'q';
wchar_t ch2 = '?';
// Function to check if the character
// is a lowercase character or not
if (iswlower(ch1))
wcout << ch1 << " is a lowercase character ";
else
wcout << ch1 << " is not a lowercase character ";
wcout << endl;
if (iswlower(ch2))
wcout << ch2 << " is a lowercase character ";
else
wcout << ch2 << " is not a lowercase character ";
return 0;
}
輸出:
q is a lowercase character ? is not a lowercase character
相關用法
- C++ log()用法及代碼示例
- C++ div()用法及代碼示例
- C++ fma()用法及代碼示例
- C++ map key_comp()用法及代碼示例
- C++ real()用法及代碼示例
- C++ imag()用法及代碼示例
- C++ valarray log()用法及代碼示例
- C++ regex_iterator()用法及代碼示例
- C++ valarray pow()用法及代碼示例
注:本文由純淨天空篩選整理自IshwarGupta大神的英文原創作品 iswlower() function in C/C++。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。