uTools-Manuals/docs/c/getkey.html
2019-04-21 11:50:48 +08:00

33 lines
640 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>标准库函数 - getkey</h1>
<p>原型extern int getkey(void);</p>
<p>用法:#include &lt;system.h></p>
<p>功能:读键</p>
<p>说明功能同getchar</p>
举例:<pre><code class="language-c">
// getkey.c
#include &lt;system.h>
main()
{
int c;
clrscr();
printf("Press key...");
while((c=getkey())!='Q')
{
clrscr();
printf("key: %c\nvalue: %x",c,c);
}
}
</code></pre>相关函数:<font color=gray>getch,getchar,kbhit</font>