Sounds like you need to just index it. Make an array that will hold the same number of elements as you have structures.
"Sort" the list of structures by using a simple array of integers to reference the individual structures. Example:
Thus, your sorted index would be:
foo.name is "Joe"
foo.name is "Bob"
foo.name is "Sue"
Then you do something nifty like:
index = 1;
index = 0;
index = 2;
Nice and easy. Or you could just actually sort your array of stuctures. Or you could use an array of pointers to structures, and sort that.
void displaysortedlist( struct foo list, int index )
int x = 0;
for( x = 0; x < TOTAL; x++ )
printf("Name %d is %s\n", x, list[ index[x] ].name );
Probably best to pick whatever it is your assignment requires hoever.