uTools-Manuals/docs/c/isascii.html
2019-04-08 23:22:26 +08:00

38 lines
843 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>字符函数 - isascii</h1>
<p>原型extern int isascii(int c);</p>
<p>用法:#include &lt;ctype.h></p>
<p>功能判断字符c是否为ascii码</p>
<p>说明当c为ascii码时返回非零值否则返回零。ascii码指0x00-0x7F之间的字符</p>
举例:<pre>
// isascii.c
#include &lt;syslib.h>
#include &lt;ctype.h>
main()
{
char s[]="文曲星-BJGGV";
int i=12; // length of string s
clrscr(); // clear screen
textmode(0xE0); // make sure LCD mode is 3 big line
printf("%s\n",s);
for(i=0;i<12;i++)
{
if(isascii(s[i])) putchar('^');
else putchar('.');
}
getchar();
return 0;
}
</pre>相关函数:无