c++函数中调用vc++_C ++中的iswlower()函数

c++函数中调用vc++

The iswlower() function is defined in the header file <cwctype.h>.

iswlower()函数在头文件<cwctype.h>中定义。

Prototype:

原型:

    int iswlower(wchar_t rs);

Parameter:

参数:

wchar_t rs – Checks the given character is in lower case or not.

wchar_t rs –检查给定字符是否小写。

Return type:

返回类型:

The function returns two values:

该函数返回两个值:

  1. Zero: if rs is non - lowercase character.

    零:如果rs为非小写字符。

  2. Non Zero: if rs is lowercase character.

    非零:如果rs是小写字符。

Use of function

使用功能

The iswlower() is built- in function in C++, which is used to check the given character, rs is in lower case or not .

iswlower()是C ++中的内置函数,用于检查给定字符,而rs是否为小写。

Program 1:

程序1:

#include <cwctype> 
#include <iostream> 
using namespace std; 

int main() {   
	wchar_t rs1 = 'H'; 
	wchar_t rs2 = 'e'; 
	wchar_t rs3 = 'l';
	wchar_t rs4 = 'P';

	// Function to check if the character 
	// is a lowercase character or not 
	if (iswlower(rs1)) 
		wcout << rs1 << " is a lowercase "; 
	else
		wcout << rs1 << " is not a lowercase "; 
	wcout << endl; 

	if (iswlower(rs2)) 
		wcout << rs2 << " is a lowercase "; 
	else
		wcout << rs2 << " is not a lowercase "; 
	wcout << endl; 
	
	if (iswlower(rs3)) 
		wcout << rs3 << " is a lowercase "; 
	else
		wcout << rs3 << " is not a lowercase  "; 
	wcout << endl; 
	
	if (iswlower(rs4)) 
		wcout << rs4 << " is a lowercase  "; 
	else
		wcout << rs4 << " is not a lowercase  "; 
	wcout << endl; 

	return 0; 
}

Output

输出量

H is not a lowercase 
e is a lowercase 
l is a lowercase 
P is not a lowercase  


Program 2:

程式2:

#include <cwctype> 
#include <iostream> 
using namespace std; 

int main() {   
	wchar_t rs1 = '.'; 
	wchar_t rs2 = 'c'; 
	wchar_t rs3 = '?';
	wchar_t rs4 = 'm';

	// Function to check if the character 
	// is a lowercase character or not 
	if (iswlower(rs1)) 
		wcout << rs1 << " is a lowercase "; 
	else
		wcout << rs1 << " is not a lowercase "; 
	wcout << endl; 

	if (iswlower(rs2)) 
		wcout << rs2 << " is a lowercase "; 
	else
		wcout << rs2 << " is not a lowercase "; 
	wcout << endl; 
	
	if (iswlower(rs3)) 
		wcout << rs3 << " is a lowercase "; 
	else
		wcout << rs3 << " is not a lowercase  "; 
	wcout << endl; 
	
	if (iswlower(rs4)) 
		wcout << rs4 << " is a lowercase  "; 
	else
		wcout << rs4 << " is not a lowercase  "; 
	wcout << endl; 

	return 0; 
}

Output

输出量

. is not a lowercase 
c is a lowercase 
? is not a lowercase  
m is a lowercase  


翻译自: https://www.includehelp.com/cpp-programs/iswlower-function.aspx

c++函数中调用vc++

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值