You haven't made the changes you've been told about:
Code:
for(slot=0; slot<MAX; slot++)
if(strcmp(sn,&people[slot].surname)==0);
flagcmp=1;
if(flagcmp==1)
{
printf("Your name %s %s\n",people[slot].firstname,people[slot].surname);
printf("Home telephone is %s\n",people[slot].home_number);
printf("Mobile telephone is %s\n",people[slot].mobile_number);
}
else
printf("\nThey are not in the list");
Problem. As stated, this is in effect, making your search not work right. Fix that, then see how it works.
Problem. You don't need the address-of operator there, since what you're passing is in fact a pointer (the name of the array, surname) already.
Quzah.