qsort関数の比較関数について質問です。
struct StudentA{
  int id;
  int english;
  int math;
  int chem;
};
struct StudentB{
  int id;
  int subject[3];
};

int compA(const void *a,const void *b){
  return ((struct StudentA *)a)->english - ((struct Student A *)b)->english;
}

void main(){  
  int key;
  struct StudentA seitoA[5];
  struct StudentB seitoB[5];

  qsort(seitoA,5,sizeof(struct StudentA),compA);
  key=2; /* 例えば */
  qsort(seitoB,5,sizeof(struct StudentB),compB);
}
englishの値によってseitoAを並び替える比較関数compAは作れるんですが、
subject[key]の値によってseitoBを並び替える比較関数がうまく作れません。
教えていただけないでしょうか。