问答题

下列函数的功能是求链表长度,填空完成程序。 struct node {char ch; struct node*link; }; str(struct node*p) {int ① ; while(p!=NULL) { ② ; count++: } return(count); }

【参考答案】

正确答案:①count=0 ②p=p一>next