I am trying to get a program to loop infinately, I want it to keep looping until it receives input from the keyboard, this is what i have..


#include <stdio.h>
#include <conio.h>

int main(){

char userin;

while(1)
{


....do stuff...

userin = getche();
if(userin = 'g')
{

...do something else...

}
}
}

As the program is it will loop (do stuff) once and wait for input, how do i make it continue looping and stop on input

Any help would be appreciated