Trimming Rand Int Values

Hello. I am trying to create a program in C++ that simulates rolling dice. I am trying to create a random integer value using the srand and rand functions, but am not sure how I should "trim" the returned value to a die number between 1 and 6 (which I have declared as global MIN and MAX variables) simplistically. Any help would be greatly appreciated.
That's what the modulo operation is for: int roll=rand()%(MAX-MIN+1)+MIN;
Ah wow I feel dumb. Thank you very much.
Topic archived. No new replies allowed.