Hi All,
I am new member of this forum. I am trying to implement the simple c logic for the following problem :
I want to come out of a while loop only when I press the key 'e' But condition is that, it should not wait for me to enter a key during each iteration as in the following code,
int i = 0;
char c = 'a';
while(1)
{
printf("%d",i++);
if(getch() == 'e')
break;
}
here each time I need to enter a key then it checks if it is 'e' and then it continues, but I dont want it to wait for me.It should ignore all the keys except 'e' without waiting.
If anybody can provide a logic, please reply