getche

getche是一種函式,功能是輸入後立即從控制台取字元。

基本介紹

  • 中文名:getche
  • 功 能:輸入後立即從控制台取字元
  • 用 法:int getche(void
  • 頭檔案:<conio.h>
函式特點,程式示例,

函式特點

函式名:getche()
功 能:輸入後立即從控制台取字元,不以回車為結束(帶回顯)
用 法:int getche(void);
頭檔案:<conio.h>
返回值:返回輸入字元對應的ASCII碼

程式示例

#include<stdio.h>
#include<conio.h>
int main(void)
{
char ch;
printf("Inputacharacter:");
ch=getche();
printf("\nYouinputa'%c'\n",ch);
return 0;
}

相關詞條

熱門詞條

聯絡我們