i've been stuck for days now so... i'm trying to compare two objects, one is p of type plane, the other is a plane stored in l[i] of type list. i need to overload the operator< to compare the two types using strcmp so i have:
i can't seem to figure out how i can access list l at position [i] to compare it to the other plane. do i need a friend function? thanks.Code:bool operator< (const plane& p) const { //postcondition: returns true if the implicit argument //is less than the explicit argument using a key of //model name, tail number order const char* pModel = p.getModel(); const char* pNum = p.getNumber(); if (strcmp(pModel, ????) < 0 && strcmp(pNum, ????) < 0) return true; else return false; }