I'm trying to create 1000 random numbers using an array. I keep getting the same number everytime, though. How do I get 1000 different random numbers? Here's what I have so far:
[LIST=1]
[*]#include "stub.h"
[*]int main()
[*]{
[*] int number[1000], i;
[*] int r[1000];
[*]
[*] for(i=0; i<1000; i++)
[*] {
[*] r[i] = (rand() % 10) +1;
[*] srand(time(NULL));
[*] cout << " " << r[i] << " ";
[*] }
[*] getchar();
[*]
[*] return 0;
[*]}
[/LIST]