mercredi 4 février 2015

generating random numbers for array elements


Vote count:

0




Hi.I have a problem in generating binary random numbers in C++. i want to make an array and each element contain random numbers in binary form. and i want to XOR elements together. this is my code :



int array[30];
srand ( time(0) );
for (int j = 0;j<30;j++)
i = rand();
array[j]=i
double x = array[j]^ array[j+1]^ array[J+2];
return x;


It doesn't work and It doesn't make binary random numbers can anyone help me how should i fix it ?



asked 25 secs ago







generating random numbers for array elements

Aucun commentaire:

Enregistrer un commentaire