3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by WaltP
0

Are we talking about manipulating clipboard data or catching command line signals (though I'm not familiar with ctrl+v as a signal)?

0

Yes, catching command line signal. What I was coding is, user can enter a string untill he/she presses ctrl+c. It will be in command prompt.

0

You'll need to catch and handle the SIGINT signal:

#include <stdio.h>
#include <signal.h>

volatile sig_atomic_t caught = 0;

void handler(int signum)
{
    caught = 1;
}

int main(void)
{
    signal(SIGINT, handler);

    while (!caught)
        puts("Booger");

    puts("Got it!");
    getchar();

    return 0;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.