dimanche 29 mars 2015

this doesnt compile and i dont know the error in this.please cooperate since i am a beginner



template<class Type> Type ArrayPQ<Type>::removeMin(void ) throw(exception)
{
if (isEmpty())
{
cout << "Empty Priority Queue\n";
}
else
{
Type min = array[0];
array[0] = array[heap];
heap--;
minHeapify(0);
return min;
}
}


I keep getting this warning:


In file included from runtime_analysis.cpp:7: ./PQ3.h:57:1: warning: control may reach end of non-void function [-Wreturn-type] } ^ ./PQ3.h:114:9: note: in instantiation of member function 'ArrayPQ::removeMin' requested here removeMin(); ^ runtime_analysis.cpp:67:12: note: in instantiation of member function 'ArrayPQ::DeleteAll' requested here ArrPQ->DeleteAll(); ^ 1 warning generated.


And whenever I run the code I get an error...




Aucun commentaire:

Enregistrer un commentaire