try something like this
Code:
#include <stdlib.h>
int min=1,max=300,randomnum;
int main(...) {
init();
...
do();
do();
return 0;
}
void init() {
srand(time(NULL));
}
void do() {
randomnum = min + rand()%(max-min+1);
}
and if you want to be sure none of the random numbers generated get repeated, put them in a stringlist or something like that and check the list every time you generate a new "random" number.
but if you use the srand(time(NULL)); i dont think you´ll get same number twice ^^
hope this helps