void f(int);
void main()
{
signal(SIGINT, f);
int i = 4;
while(i < 1000)
{
sleep(10);
i++;
}
}
void f( int signum ){
printf ( "OUCH \n") ;
}
if I hit "ctr C" while the program is looping, it prints out "OUCH" to the terminal. Is there anyway I can print out the current number that the program is looping using signal handler.