我有一个结构的名字排序结构的数组按字母顺序与具有空间
struct BookInfo
{
char title[50];
int numAuthors;
char authors[50][50];
int year;
int checkedout;
};
我可以通过多年的排序,但我不能让它通过标题为我所有我的代码做的生命排序是打印出它们的顺序依次在文件中或我得到“在assingment不兼容的类型”错误的comented线
int j,i;
char temp;
for(i = 1; i < 14; i++)
{
j = i - 1;
while(j >= 0 && strcmp(library[j+1].title, library[j].title) < 0)
{
temp = library[j + 1]; /*errors*/
library[j+1] = library[j];
library[j] = temp; /*errors*/
j--;
}
printf("n%s",library[j].title);
}
的名字我在做什么错在这里?
是什么类型库? – 2013-05-06 09:07:36
struct BookInfo库[500]; – Tatan1 2013-05-06 09:12:42