randomize()函数在VC中好像不能用,有其他函数能代替它吗?
randomize()函数在VC中好像不能用,有其他函数能代替它吗?先谢谢了。
程序代码:int InitializeWild(CREATURE *temp)
{
if ((NULL == temp) || (LEN != sizeof(*temp)))
{
printf("\n初始化野外生物构造体指针传递失败。\n");
return(0);
}
else
{
srand((int)time(NULL));
strcpy(temp->name, "Wild");
temp->hp = 1 + rand() % 15;
temp->attack = rand() % 6;
temp->defence = rand() % 6;
temp->maxDamage = 1 + (temp->minDamage = 1 + rand() % 2) + rand() % 2;
temp->speed = 1 + rand() % 10;
temp->flag = 1;
printf("\n野外生物构造体初始化成功。\n");
return(1);
}
}
