And easier way to seed off of time is:

srand(time(NULL));