struct planestats {
int seat_id;
int status;
char last[LEN];
char first[LEN];
}
struct planestats array[12];
只是进行了3个结构体的赋值,gets(last[0]),gets(last[1]),gets(last[2]),
for (top = 0; top < limit -1; top++)
for (search = top + 1; search < limit; search++)
if (strcmp(array[search]->last, array[top]->last) < 0)
{
temp = array[search];
array[search] = array[top];
array[top] = temp;
}
只是赋值了3个成员就可以全员比较吗?
int seat_id;
int status;
char last[LEN];
char first[LEN];
}
struct planestats array[12];
只是进行了3个结构体的赋值,gets(last[0]),gets(last[1]),gets(last[2]),
for (top = 0; top < limit -1; top++)
for (search = top + 1; search < limit; search++)
if (strcmp(array[search]->last, array[top]->last) < 0)
{
temp = array[search];
array[search] = array[top];
array[top] = temp;
}
只是赋值了3个成员就可以全员比较吗?
