hello i have an error with the following code:
in my h file i got the following vector:
vector<Vehicale*> m_vehicalesVector;
and in my cpp file i got the following function:
void Adjutancy:: AddVehicale(const Vehicale* vehicaleToAdd)
{
m_vehicalesVector.push_back(vehicaleToAdd);
}
seems like the const Vehicale* vehicaleToAdd is making the problem when i change it to a non const variable it works.
thanks in advance.
m_vehicalesVector.push_back()needsVchicale*as its parameter, whileconst Vehicale*is given. Compiler denies this becauseconstcannot be removed silently.Change
vector<Vehicale*> m_vehicalesVectortovector<const Vehicale*> m_vehicalesVectorcan solve this problem.