Help with implementing signal handlers via signal()
Posted
by scott
on Stack Overflow
See other posts from Stack Overflow
or by scott
Published on 2010-04-19T11:48:59Z
Indexed on
2010/04/19
12:43 UTC
Read the original article
Hit count: 355
void main ()
{
int c;
signal (SIGINT, Handle);
while (( c = getchar()) != '\n' );
return();
}
void Handle(signum)
{
signal {SIGINT, Handle);
printf ("beep \n");
}
I thought it would print 'beep' until any key has been pressed but the method call is outside the loop? :S
© Stack Overflow or respective owner