   casting time() to unsigned?
  http://www.robertjacobs.fsnet.co.uk/random.htmSection 4 has this code:#include <cstdlib>#include <ctime>#include <iostream>using namespace std;int main(){    srand(static_cast(time(0)));    int random_integer;    for(int index=0; index<10; index++){   random_integer = rand();   cout << random_integer << endl;    }}  While I understand it is being static casted, what I don''t understand is why this was thought to be needed.  srand(time(0)); Substituting the above line seems to work fine.  What reason is there to static cast? 
  It was done for the sake of explicit completeness.Though notice the forum ate the type-id of the static_cast. #include <cstdlib>#include <ctime>#include <iostream>using namespace std;int main(){srand(static_cast<unsigned>(time(0)));int random_integer;for(int index=0; index<10; index++){random_integer = rand();cout << random_integer << endl;}}  [edited by - Mastaba on December 8, 2003 9:09:08 PM]