回复 8楼 azzbcc
改了!不过输出不对啊 输出NULL
2012-12-11 20:42
struct student stru[4] = {{"wang",24},{"wwe",27},{"wll",30},{"yyf",34}};
这里把它初始化为结构体数组
程序代码:struct student
{
char name[10];
int age;
struct student *next;
};
并没有给next任何地址,而是只有调用它
程序代码: while(p != NULL)
{
array[i] = (p->age)-age;
p = p->next;
if(array[i]<0)
array[i] = 0 -array[i];
i++;
}
所以这个循环只会一次,或者说是错误的,因为next都没有初始化
2012-12-11 20:44
2012-12-11 20:49
2012-12-11 20:53
2012-12-11 20:54
2012-12-11 20:54
2012-12-11 20:55
2012-12-11 20:58

2012-12-11 21:01
2012-12-11 21:01