nowill - 2007-2-2 16:42:00
#define N 4
#include "stdio.h"
static struct man
{ char name[20];
int age;
} person[N]={"li",18,"wang",19,"zhang",20,"sun",22};
main()
{struct man *q,*p;
int i,m=0;
p=person;
for (i=0;i<N;i++)
{if(m<p->age)
q=p++;
m=q->age;}
printf("%s,%d",(*q).name,(*q).age);
}
NirvanaCrystal - 2007-2-8 16:57:00
你的错误大了。。。你的判断里面写的是什么啊。。
你的q指向哪了啊。。。你都没有指向。所以你的那个指针是野指针啊。。
© 2000 - 2026 Rising Corp. Ltd.