time - How can I get rid of the warning with rand()? (C++) -


whenever I use the Rand function in C ++:

  #include & Lt; Iostream & gt; #to & lt include, time.h> #to & lt include, stdlib.h & gt; using namespace std; Int main () {srand (time (0)); Int n = (rand ()% 6) +1; Cout & lt; & Lt; "Dice is rolled" & lt; N & lt; & Lt; "." & Lt; & Lt; Andal; }  

I get a warning about the conversion, which is from line_ty to line 5:

  srand (time (0));  

Is there any way to get rid of this warning?

Actually, you should use it:

  srand ( (Unsigned) time (0));  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -