I want to create a code in C, that runs a loop and breaks the loop when I hit '1' BUT without pressing ENTER after it.
I use the GCC compiler.
example Code:
While-loop has to run always without pause, until I press '1' but without hitting ENTER ...(bin/stty raw)
int c=0;
int leave=0;
system ("/bin/stty raw");
while ((leave=getchar()) != '1'){
c++;
printf("\n- - while loop nr. %d\n",c);
sleep(1);
}
system ("/bin/stty cooked");
printf("\n-- end of loop...\n");*
...