All pastes #499523 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-21 03:00 UTC
rendered paste body
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>

    void catch() {
        printf("ctrl-c was pressed\n");
        exit(0);
    }

    int main() {

        signal(SIGINT, catch); //set signal handler.. catch interrupt

        while(1) {
            //loop.. wait for ctrl-c    
        }

        return 0;
    }