lundi 5 septembre 2016

Trying to generate random array of integers, getting the same list each run. C++ [duplicate]

This question already has an answer here:

Why does this result in the same array every time i run it?

int arr[100];
for (int i = 0; i < 100; i++) {
    arr[i] = rand() % 11 + (-5); 
}




Aucun commentaire:

Enregistrer un commentaire