mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 15:04:05 +08:00
33 lines
608 B
HTML
33 lines
608 B
HTML
<h1>标准库函数 - getkey</h1>
|
||
|
||
|
||
<p>原型:extern int getkey(void);</p>
|
||
|
||
<p>用法:#include <system.h></p>
|
||
|
||
<p>功能:读键</p>
|
||
|
||
<p>说明:功能同getchar</p>
|
||
|
||
举例:<pre><code class="language-c">
|
||
|
||
// getkey.c
|
||
|
||
#include <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>
|
||
|