关于结构数组问题。。。
char (*temp)[MAXBKS];int top,seek;
for(top=0;top<num-1;top++)
for(seek=top+1;seek<num;seek++)
if(strcmp(library[top].title ,library[seek].title )>0)
{
temp=library[top].title;
library[top].title =library[seek].title ;
library[seek].title =temp;
/*strcpy(temp,library[top].title);
strcpy(library[top].title,library[seek].title);
strcpy(library[seek].title,temp);*/
}
}
是字符串排序的问题,为什么这样会报错呢?结构里的字符串不能使用首地址吗????
希望了解的可以解答一下。
D:\Visualc\lesson1\project10\Text2.c(71) : warning C4047: '=' : 'char (*)[10]' differs in levels of indirection from 'char *'
D:\Visualc\lesson1\project10\Text2.c(72) : error C2106: '=' : left operand must be l-value
D:\Visualc\lesson1\project10\Text2.c(73) : warning C4047: '=' : 'char [40]' differs in levels of indirection from 'char (*)[10]'
D:\Visualc\lesson1\project10\Text2.c(73) : error C2106: '=' : left operand must be l-value