C 中的 ispunct()
函数 ispunct() 用于检查所传递的字符是否为标点符号。如果不是标点符号,则返回零;否则返回一个非零值。
以下是在 C 语言中 ispunct() 的语法:
int ispunct(int character);
以下是在 C 语言中 ispunct() 的一个示例:
示例
#include <stdio.h>
#include<ctype.h>
int main() {
int a = '!';
int b = 'a';
if(ispunct(a))
printf("The character is a punctuation.");
else
printf("
The character is not a punctuation.");
if(ispunct(b))
printf("
The character is a punctuation.");
else
printf("
The character is not a punctuation.");
return 0;
}输出
The character is a punctuation. The character is not a punctuation.
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP