Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม C

ฟังก์ชัน iswlower() ใน C/C++

ฟังก์ชัน iswlower() ตรวจสอบว่าตัวอักษรกว้าง (wide character) เป็นตัวพิมพ์เล็ก (lowercase) หรือไม่ ประกาศอยู่ใน cwctype (C++) หรือ ctype.h (C)

คืนค่า 0 หากไม่ใช่ตัวพิมพ์เล็ก และคืนค่าที่ไม่ใช่ 0 หากเป็นตัวพิมพ์เล็ก

รูปแบบไวยากรณ์

int iswlower(wint_t ch)

ตัวอย่าง

#include <cwctype>
#include <iostream>
using namespace std;
int main() {
    wchar_t c = 'S';
    if (iswlower(c))
        wcout << c << ", The character is a lowercase character ";
    else
        wcout << c << ", The character is not a lowercase character ";
    wcout << endl;
    return 0;
}

ผลลัพธ์

S , The character is not a lowercase character