vendredi 2 octobre 2020

C - Any way to initialize srand multiple times?

Is there any way to initialize srand multiple times? I have an specific function to generate random numbers but every time i call it gives the same number. Any way to fix this?

int whoatk2() {
    srand(time(NULL));
    int a;
    a = rand() % 50;
    return a;
}



Aucun commentaire:

Enregistrer un commentaire