トップページ > キーワード検索 > ispunct()
C言語規格
C言語(その他)
プログラム
その他
ispunct()
機能 区切り文字であるかどうかを検査する。
定義 #include <ctype.h>

int ispunct ( int c );
引数
c検査する文字
戻り値 区切り文字ならば、0以外を返す。
区切り文字でないなら、0を返す。
実装例
#include <ctype.h>
#include <stdio.h>

int main(void)
{
    char c = '(';
    int ret;
    
    ret = ispunct( c );
    
    if (ret != 0) {
        printf("%c は区切り文字である\n", c);
    } else {
        printf("%c は区切り文字でない\n", c);
    }
    return 0;
}
実行結果
( は区切り文字である





inserted by FC2 system