mardi 19 novembre 2019

How to get an ACTUAL random number in c++ [duplicate]

I am trying to get c++ to give me a randomly generated number but whenever I try to get a random number, it always gives me the same number. I tried to generate the number multiple times at once to see if I was just getting multiple of the same numbers in a row but then I got a pattern of numbers that never, ever changes.

This is the problem code:

iRandom = rand() % 2;

I am trying to get this to randomly decide the player in a small game.




Aucun commentaire:

Enregistrer un commentaire