Can someone please help me figure out what this function does ?
It's suposed to det an integer number between the "temp" value yet when I run the program and I give in a value it just keeps on looping... (Id'like to post the whole program... can i ? It's the infamous Game of Life...)
Thanks
Code:
int Get_int_in_range(int min, int max) {
int temp;
scanf("%d", &temp);
while ( (temp < min) || (temp > max) ) {
printf("Please enter a number >= %d and <= %d\n", min, max);
scanf("%d", &temp);
}
return temp;
}