单项选择题

如下程序的功能为对链表中所有结点数据域内容求和,其中head指向一个带头结点的单链表,在下划线处需要分别填入的正确内容为______。 struct link{    int data;    struct link * next; } int main(void){   struct link * head;   sum(head); } int sum(____){    struct link * p;    int s=0;    p=head->next;    while(p){      s+=____;      p=____;    } }

A.struct link *head   p->next->data    p->next
B.struct link *head   p->data          p->next
C.struct link *head   p->data          p
D.struct link head    p->data          p->next
微信扫码免费搜题