ispunct() 함수는 전달 문자가 구두점인지 여부를 확인하는 데 사용됩니다. 구두점이 아니면 0을 반환하고, 그렇지 않으면 0이 아닌 값을 반환합니다.
다음은 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("\nThe character is not a punctuation.");
if(ispunct(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.