mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-03-04 12:17:35 +08:00
v0.0.2
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
<h1>字符函数 - isprint</h1>
|
||||
|
||||
|
||||
<p>原型:extern int isprint(int c);</p>
|
||||
|
||||
<p>用法:#include <ctype.h></p>
|
||||
|
||||
<p>功能:判断字符c是否为可打印字符(含空格)</p>
|
||||
|
||||
<p>说明:当c为可打印字符(0x20-0x7e)时,返回非零值,否则返回零。</p>
|
||||
|
||||
举例:<pre><code class="language-c">
|
||||
|
||||
// isprint.c
|
||||
|
||||
#include <syslib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
main()
|
||||
{
|
||||
int c;
|
||||
|
||||
clrscr(); // clear screen
|
||||
c='a';
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
c=' ';
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
c=0x7f;
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
</code></pre>相关函数:<a href="isgraph.html">isgraph</a>
|
||||
|
||||
<h1>字符函数 - isprint</h1>
|
||||
|
||||
|
||||
<p>原型:extern int isprint(int c);</p>
|
||||
|
||||
<p>用法:#include <ctype.h></p>
|
||||
|
||||
<p>功能:判断字符c是否为可打印字符(含空格)</p>
|
||||
|
||||
<p>说明:当c为可打印字符(0x20-0x7e)时,返回非零值,否则返回零。</p>
|
||||
|
||||
举例:<pre><code class="language-c">
|
||||
|
||||
// isprint.c
|
||||
|
||||
#include <syslib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
main()
|
||||
{
|
||||
int c;
|
||||
|
||||
clrscr(); // clear screen
|
||||
c='a';
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
c=' ';
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
c=0x7f;
|
||||
printf("%c:%s\n",c,isprint(c)?"yes":"no");
|
||||
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
</code></pre>相关函数:<a href="isgraph.html">isgraph</a>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user