你所说的问题是不会发生的,这和指针没关系,我出代码你可以尝试看看
srand(unsigned(time(NULL)));
int card[54],t,r,i;
for(i=0;i<54;i++)
{
card[i]=i;
}
for(i=0;i<54;i++)
{
t=card[i];
r=(int)(54*rand()/(RAND_MAX+1.0));
t=card[r];
card[r]=i;
card[i]=t;
}
srand(unsigned(time(NULL)));
int card[54],t,r,i;
for(i=0;i<54;i++)
{
card[i]=i;
}
for(i=0;i<54;i++)
{
t=card[i];
r=(int)(54*rand()/(RAND_MAX+1.0));
t=card[r];
card[r]=i;
card[i]=t;
}