این تابع return pb ارور میده باید چیکارش کنم؟
/*int getcontactfname (char fname[],list *pb)
{
while (pb!=NULL&&strcmp(pb->firstname,fname))
pb=pb->next;
return pb;
}
یه سوال دیگه چجوری این تابع رو فراخوانی کنم؟
void addcontact(char fname[],char lname[],char number[],list **phonebook)
{
list *contact=(list*)malloc(sizeof(list));
contact->next==NULL;
strcpy(contact->firstname,fname);
strcpy(contact->lastname,lname);
strcpy(contact->number,number);
if(*phonebook==NULL)
*phonebook=contact;
else
{
list *last=*phonebook;
while(last->next!=NULL)
last=last->next;
last->next=contact;
}
}
/*int getcontactfname (char fname[],list *pb)
{
while (pb!=NULL&&strcmp(pb->firstname,fname))
pb=pb->next;
return pb;
}
یه سوال دیگه چجوری این تابع رو فراخوانی کنم؟
void addcontact(char fname[],char lname[],char number[],list **phonebook)
{
list *contact=(list*)malloc(sizeof(list));
contact->next==NULL;
strcpy(contact->firstname,fname);
strcpy(contact->lastname,lname);
strcpy(contact->number,number);
if(*phonebook==NULL)
*phonebook=contact;
else
{
list *last=*phonebook;
while(last->next!=NULL)
last=last->next;
last->next=contact;
}
}