The remainder of the program defines the functions called from main:
void sort(list, key)
struct namelist list[];
short key;
{
short
i,j,k;
long
min;
char
*name;
struct namelist worklist;
switch(key){
case NAME :
for (i = 0 ; *list[i].name != 0 ; i++){
name
=
list[i].name;
k = i;
for (j = i+1 ; *list[j].name != 0 ; j++){
if
(strcmp(list[j].name
,
name)
<
0){
name
=
list[j].name;
k = j;
}
}
worklist
=
list[i];
list[i]
=
list[k];
list[k]
=
worklist;
}
break;
case AGE :
for (i = 0 ; list[i].age != 0 ; i++){
min
=
list[i].age;
k = i;
for (j = i+1 ; list[j].age != 0 ; j++){
if
(list[j].age
<
min){
min
=
list[j].age;
k = j;
}
}
worklist
=
list[i];
list[i]
=
list[k];
list[k]
=
worklist;
}
break;
case ID :
for (i = 0 ; list[i].idcode != 0 ; i++){
min
=
list[i].idcode;
k = i;
for (j = i+1 ; list[j].idcode != 0 ; j++){
if
(list[j].idcode
<
min){
min
=
list[j].idcode;
k = j;
}
}
worklist
=
list[i];
list[i]
=
list[k];
list[k]
=
worklist;
}
break;
}
}
48
www.DataSheet4U.com
Содержание CE2000-H8S Series
Страница 2: ...Blank Page www DataSheet4U com...
Страница 22: ...Blank Page 8 www DataSheet4U com...
Страница 41: ...Blank Page 27 www DataSheet4U com...
Страница 57: ...Figure 6 1 Basic Bus Cycle Timing in Expanded mode 43 www DataSheet4U com...
Страница 59: ...Blank Page 45 www DataSheet4U com...
Страница 84: ...70 Blank Page www DataSheet4U com...
Страница 88: ...Part Number 8830E 080 170S Unit mm inch B 2 www DataSheet4U com...
Страница 95: ...Renesas Technology Asia Sales Offices URL http www renesas com G 1 www DataSheet4U com...
Страница 96: ...CE2000 www DataSheet4U com...