#include<stdio.h>
#include<signal.h>
#include<stdlib.h>
void handler(int signo)
{
printf("First statement");
system("date");
exit(EXIT_SUCCESS);
}
int main()
{
signal(SIGINT,handler);
printf("Waiting for KeyboardInterrupt\n");
for(;;);
return 0;
}
테스트 실행을 호출 삭제하기 없습니다 : -표준 버퍼 시스템 전에()
[email protected]:~/c$ gcc main.c
[email protected]:~/c$ ./a.out
Waiting for KeyboardInterrupt
^CWed Mar 10 23:55:47 IST 2010
First [email protected]:~/c$
왜 시스템 후 인쇄하기 "첫 번째 문"는()를 호출?
thats what i want .. :) –