The time function, actually expects a pointer as an argument. Passing 0 is the same thing as passing NULL. That's why you see people use either srand(time(0) or srand(time(NULL). Passing 1 as an argument causes the program inproperly, because 1 is not a valid memory address (pointer).