求怎么输出多个伪随机数

int a[1000];
for(int b=0;b<1000;++b)
{
srand((int)time(0));
}
for(int j=0;j<1000;j++)
{

    a[b]=rand();

}
我写的是上面的,总是报错,不知道哪里错了,跪求大神啊

srand调用1次就行
错误在于 a[b] 总下标 b 已经超出定义的作用范围。

int a[1000];
srand((int)time(0));
for(int j=0;j<1000;j++)
{
    a[j]=rand();
}

http://zgjmail1017.blog.163.com/blog/static/1218567702011527271620/