请输入您要查询的百科知识:

 

词条 isdigit
释义

isdigit

原型:extern int isdigit(char c);

用法:#include <ctype.h>

功能:判断字符c是否为数字

说明:当c为数字0-9时,返回非零值,否则返回零。

附加说明 此为宏定义,非真正函数。

举例:

// isdigit.c

#include <syslib.h>

#include <ctype.h>

main()

{

int c;

clrscr(); // clear screen

c='a';

printf("%c:%s\",c,isdigit(c)?"yes":"no");

c='9';

printf("%c:%s\",c,isdigit(c)?"yes":"no");

c='*';

printf("%c:%s\",c,isdigit(c)?"yes":"no");

getchar();

return 0;

}

相关函数:isalnum,isalpha,isxdigit,iscntrl,isgraph,isprint,ispunct,isspace

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/22 7:39:24