I need to create a function that prompts a user to enter an integer between a minimum and maximum value, lets say 0 to 100. Then the function needs to verify the value is within range and then store it. We have to make the function under a seperate c file and then call it, with the whole idea being we can use this function on other programs in the future.
the definition would be something along the lines of:
int GetInt (int min, int max)
It seems simple enough, I would just store the value to a variable and do an if statement, if the variable is less than max and greater than min, store it. The part that throws me off is the function has to be universal, I need to call it 3 times in this program from a seperate c file. How do I go about that? It seems so simple if the function was only going to be used once, I could just store the input to a variable and be set, but by storing it to that set variable I can't call the function 2 more times. Any tips, help or suggestions would be greatly appreciated