let say i'm in an infinite while loop and i want the user to enter the data in integer form. Then the data will be passed to another function for some other purpose this process will keep continuing until the user input esc in the place of data and i want the loop to break at that point. how should i do that?
while(1)
{
printf("enter the data that need to entered\npress esc to exit\n");
scanf("%d",&n);
function(n);
}
i tried to use if-else but if i put the ascii value of esc as the data input it exits the loop which i don't want to happen?