I'm a beginner with C++, I'm experimenting with arrays and can't seem to figure out how to fill an array with random values. The code below fills the entire array with the same random value. Can anyone tell me what I'm doing wrong?
const int size = 50; //array size
int nums[size]; //array
for(int i = 0; i < size; i++)
{
srand(time(NULL));
nums[i] = rand() % size + 1;
}