Here I am trying to get user input with getline . Having received the ^C interrupt, I want it to signal getline to stop and resume working with my program, and not to stop it.
I tried to write a new line for stdin, but apparently this does not work.
fwrite("\n", 1, 1, stdin);
So what would be a way to achieve this?
c signals stdin
Derek 朕 會 功夫
source share