NODE *creatlist(int a[], int n)//?
{
NODE *h,*p,*q;//?
int i;
h = (NODE *)malloc(sizeof(NODE));
h->next = NULL;
for(i=0; i<n; i++)
{
q=(NODE *)malloc(sizeof(NODE));//?
q->data=a[i];
q->next = NULL;
if (h->next == NULL)
h->next = p = q;
else
{
p->next = q;
p = q;
}
}
return h;
}
1.NODE creatlist(int a[], int n)为什么有星号?
2.NODE *h,*p,*q;这里的hpq表示什么?表?还是头指针?为什么?
3.q=(NODE )malloc(sizeof(NODE));为什么括号中有星号?