how can I get user string input while the program is running? I want to break the while loop when user input "stop" to terminal. However, scanf or gets just wait for the input.
This is just an example that I want.
#include <stdio.h>
int main() {
int i=0;
while (1) {
//if ( userinput == "stop") break;
printf("printing..%d\n",i++);
}
return 0;
}