mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:55:36 +08:00
38 lines
843 B
HTML
38 lines
843 B
HTML
<h1>字符函数 - isascii</h1>
|
||
|
||
|
||
<p>原型:extern int isascii(int c);</p>
|
||
|
||
<p>用法:#include <ctype.h></p>
|
||
|
||
<p>功能:判断字符c是否为ascii码</p>
|
||
|
||
<p>说明:当c为ascii码时,返回非零值,否则返回零。ascii码指0x00-0x7F之间的字符</p>
|
||
|
||
举例:<pre>
|
||
|
||
// isascii.c
|
||
|
||
#include <syslib.h>
|
||
#include <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>相关函数:无
|
||
|