C / C ++中的iswpunct()函数
该函数iswpunct()用于检查传递的宽字符是否为标点符号。如果不是标点符号,则返回零,否则返回非零值。在“cwctype”头文件中声明。
这是iswpunct()
int iswpunct(wint_t character);
这是一个例子iswpunct()
示例
#include<cwctype>
#include<stdio.h>
using namespace std;
int main() {
wint_t a = '!';
wint_t b = 'a';
if(iswpunct(a))
printf("字符是标点符号。");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\n字符是标点符号。");
else
printf("\nThe character is not a punctuation.");
return 0;
}输出结果
字符是标点符号。 The character is not a punctuation.
在上面的程序中,两个宽字符被声明为a和b。检查字符是否通过的字符是标点符号。
wint_t a = '!';
wint_t b = 'a';
if(iswpunct(a))
printf("字符是标点符号。");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\n字符是标点符号。");
else
printf("\nThe character is not a punctuation.");热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短