Vector<Medicine*>* Controller::sortByStockAsc(){
Vector<Medicine*>* all =repo->getAll();
qsort(all, all->getNrMed(),sizeof(Medicine*), (comparefunction) compareNA);
return all;}
私は上記のコードを持っていますが、qsort にはいくつかの問題があります。Vector<Medicine*>*整理する必要があるポインターの配列へのポインターです。getAll()を返しますVector <Medicine*>*。問題の 1 つは、この関数が定義されているモジュールを指定したにもかかわらず、qsort()mygetNrMed()が見つからないことです。関数は次のようになります。
int MedRepository::getNrMed(){
return MedList->getSize();
}
を返しますint。私が間違っていることは何ですか?