C program help......

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 11:53 UTC
Read the original article Hit count: 312

Filed under:
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

Related posts about c