alright, so i'm using a sighandler to interpret some signal, for this purpose it is Ctrl+C, so when Ctrl+C is typed some action will be taken, and everything is fine and dandy, but what I really need is for this to happen without ^C
appearing in the input/output
for example let's say i have this code
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
void siginthandler(int param)
{
printf("User pressed Ctrl+C\n");
exit(1);
}
int main()
{
signal(SIGINT, siginthandler);
while(1);
return 0;
}
the output would be
^CUser pressed Ctrl+C
How could I get this to simply be
User pressed Ctrl+C
?
>output
and observe that the ^C still appears in your terminal window, but does not appear in the output file. – Balanchine