I have a simple console program written in C and want to abort a text input with CTRL + Z. How is it possible?
Edit: Here is some code (untested).
#include <stdio.h>
int main()
{
float var;
while(1)
{
scanf("%lf", &var); // enter a float or press CTRL+Z
if( ??? ) // if CTRL+Z was pressed
{
break;
}
// do something with var
}
printf("Job done!");
return 0;
}