i am having quite a trouble for searching on how to ask this on google so here is my delema.
let have a simple code here.
1 2 3 4 5 6 7 8
int x=1,y=0;
while(x!=0)
{
y++;
system("cls");
cout<<y;
}
as you may have noticed it is set to an infinite loop. when you run it, its output is changing from 0 increment.
Is it possible that while the loop is running and when i input a specific char/number it would change the value of x to 0 and therefor stopping the loop.