我有一个delete关于结构数组的函数books。我正在向它传递一组记录,author of bookandname of book和size of the list.
现在在这里,list[0].author并且所有list[5].author都author等于“Dan Brown”(相同的字符串)
void delete(struct books *list,char author[],char name[],int n)
{
int i,a;
a=strcmp(list[0].author,list[5].author);
printf("%d\n",a); // prints 0
a=strcmp(list[0].author,author);
printf("%d\n",a); // prints other than 0
}
为什么会这样?这里有什么问题?