
函数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("The character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\nThe character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
return 0;
}The character is a punctuation. The character is not a punctuation.
在上面的程序中,两个宽字符被声明为a和b。检查传递的字符是否为标点符号。
立即学习“C++免费学习笔记(深入)”;
wint_t a = '!';
wint_t b = 'a';
if(iswpunct(a))
printf("The character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\nThe character is a punctuation.");
else
printf("\nThe character is not a punctuation.");以上就是在C/C++中,iswpunct()函数的作用是判断一个宽字符是否为标点符号的详细内容,更多请关注php中文网其它相关文章!
c++怎么学习?c++怎么入门?c++在哪学?c++怎么学才快?不用担心,这里为大家提供了c++速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号