struct line_3 char cipher char name int num float cost struct btable_3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// struct line_3{char cipher[M]; char name[F]; int num; float cost;};
// struct btable_3{line_3 table[N]; int amt;};
void sort_table(btable_3 *T)
{
line_3 element;
int i,j;
for(i=0;i<T->amt-1;i++)
for(j=0;j<T->amt-1-i;j++)
if(T->table[j].num>T->table[j+1].num)
{
element=T->table[j];
T->table[j]=T->table[j+1];
T->table[j+1]=element;
}
}