Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

srand() c++

#include <iostream>
#include <time.h> //you need to include this so you can use time

srand(unsigned int(time(NULL))); 
// this will try to "randomize" the value according to the current time
// some compilers will treat it as a warning if you dont define it as unsigned
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+5 =