16,472
社区成员
发帖
与我相关
我的任务
分享
ball = firstball;
while (ball != NULL)
{
//here赋值
ball = ball->next;
}
//再新创建一个ball
temp = (BALL*)malloc(sizeof(BALL));
memset(temp, 0, sizeof(BALL));
temp->x = rand()%800 +2;
temp->y = 11;
temp->cx = rand()%(num_sum - 4) - 3;
temp->cy = rand()%(num_sum - 4) - 3;
ball = temp;
ball = firstball=temp = NULL;
if (nIDEvent == 1) //等级时间间隔计时器
{ //先是方内存
temp = ball = firstball; //恢复ball指针位置
for ( ;ball != NULL;ball=ball->next)
{
free(ball);
}