#include "stdio.h"
struct link
{
int item;
struct link *next;
};
struct link *create(int b[][7],int i)
{
struct link *head,*p1,*p2,*p3;
int j;
head=(struct link*)malloc(sizeof(struct link));
head->item=b[i][0];
head->next=NULL;
for(j=1;j<7;j++)
if(b[i][j]!=0)
{
p1=head;
while(p1!=NULL){p3=p1;p1=p1->next;}
p2=(struct link*)malloc(sizeof(struct link));
p2->item=b[i][j];
p2->next=NULL;
p3->next=p2;
}
else break;
return head;
}
main()
{
struct link d[10];
int a[10][7]={{0},{1,2,5,0},{2,4,0},{2,3,0},{1,2,4,0},{1,3,0},{2,3,0},{1,3,0},{1,2,3,5,6},{1,2,3}};
int i,j,n,B[7],b[10][7];
......
谁能解释一下*p1,*p2,*p3的作用???
[此贴子已经被作者于2006-6-21 16:24:33编辑过]