Help! Getting identical random numbers?

In my program I'm getting the same random numbers. I've set the seed with the system time. I can't figure out the problem. Somebody help?

------------------------------------------------------------------------------------

#include <iostream.h>

#include <stdlib.h>

#include <time.h>

#include <iomanip.h>

void main ()

{

int how_many, max, array[40000], count=0, count2, row;

// Opening Statements

cout<<"How many numbers? ";

cin>>how_many;

while (how_many>40000 || how_many<1)

{

cout<<"Please enter a number between 1 and 40000: ";

cin>>how_many;

}

cout<<"How big are the numbers? ";

cin>>max;

//Generate random numbers

for (count=0; count<how_many; count++)

{ srand(time(NULL));

array[count]=rand() % max + 1;

}

row=how_many/10;

count2=0;

for (count=0; count<how_many; count++)

{ cout<<array[count]<<setw(7);

}

}