scanf 제한시간
미나
#include windows.h
#include stdio.h
#include stdlib.h
#include conio.h
#define MAX 10int data[MAX], j = MAX - 1,index = 0,number = 10,index2 = 0, time = 0;void menu(){
for (index = 0; index = j; index--){
if (index2 == 0){
printf(■□■□■□■□■□■\n);
printf(□ 1 : 데이터 삽입 □\n);
printf(■ 2 : 데이터 수정 ■\n);
printf(□ 3 : 데이터 출력 □\n);
printf(■ 4 : 데이터 초기화■\n);
printf(□ 5 : 종료 □\n);
printf(■□■□■□■□■□■\n);
printf(입력 : );
scanf(%d, &number);
index2++;
Sleep(500);
system(cls);
}else{
printf(□■□■□■□■□■□\n);
printf(■ 1 : 데이터 삽입 ■\n);
printf(□ 2 : 데이터 수정 □\n);
printf(■ 3 : 데이터 출력 ■\n);
printf(□ 4 : 데이터 초기화□\n);
printf(■ 5 : 종료 ■\n);
printf(□■□■□■□■□■□\n);
printf(입력 : );
scanf(%d, &number);
index2--;
Sleep(500);
system(cls);
}
}
}void main(){
menu();
}제가 짠 소스인데요 저게 계속 메뉴바가 움직이도록 사용자 정의 함수만 짜뒀는데 scanf만쓰면 멈춰가지고 입력 받을때까지안움직이더라고요 자동으로 0.5초가 지나면 scanf풀리고 다음화면으로 넘어갈수 있게는 못하나요?
-
귀염포텐
윈도우의 overlapped io같은 비동기 io로 표준 입력 스트림을 읽으면 되지 않을까요?
-
개굴츼
그럼 scanf대신에 쓸만한거는 있으시나요? 제가 c언어 시작한지 이제 2주째라서요 ㅠ
-
마음새
감사합니다 참조 해볼게요~!