I want to make a part of my program to cotinue in infinite loop unti I press any key. And when I release that key the programm should again go into the infinite loop.
The function returns 0 when the specific key is not pressed, and 1 when it is. Just stick it in your loop conditional, or make it an if-statement break check in the middle. You can use the same logic for going back in.
I ment that my program must run automatically until i press any key and when I press key it holds down. When I leave that key it again continues. Can u please write a small code explaining it.
while (true) //runs forever
{
while (keyIsPressed) //will stay in this loop while the key is pressed
{
} //when you stop pressing the key it will resume the initial while loop
}