jeudi 23 juillet 2015

c strange use of srand and rand c

Can you help me to understand what is the meaning of these randomization?

I have found it in a c code that I have to translate, it return always 41:

int main(){
  srand(1);
  printf("\n%d",rand());
}

How I can emulate the srand(1) and rand() in Java?




Aucun commentaire:

Enregistrer un commentaire