관리 메뉴

moozi

getch() enter key 본문

TIS_2019/응용sw2019_2기

getch() enter key

moozi 2019. 9. 2. 17:54

char ch;
printf("키를 누르세요\n");
while (1)
{
 ch = getch();

 if (ch == '\r')
 {
  printf("엔터키를 눌렀습니다.\n");  
  break;
 }
 else
 {
  printf("%c를 눌렀습니다.\n", ch);
 }
}

'TIS_2019 > 응용sw2019_2기' 카테고리의 다른 글

java연습문제01  (0) 2019.09.04
C연습문제08  (0) 2019.09.03
단일 문자 입력 함수(getch, getche, getchar)  (0) 2019.09.02
C연습문제07  (0) 2019.09.02
c언어버퍼비우기  (0) 2019.08.30
Comments