Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Short Question to an if statement.



  • Hello,

    this is the code:

    CityList::const_iterator iter5;
    for(iter5=all_cities.begin();iter5!=all_cities.end();iter5++)
    if(street->getStart()==??)
    {

        }
    

    I dont know what i have to fill in where the question marks are.
    It should compare street->getStart() (This returns an Pointer on a City) with the Name of the City in all_cities. The Problem is all_cities is a vector * coming from std::vector<city *> CityList;
    Dont know what to do here :(
    Thank you for every help.
    PS: My english is very bad


  • Lifetime Qt Champion

    This isn't related to Qt.
    Why do you use pointers?
    Did you try (I guess you want compare cities and not pointers, right?):

    for(iter5=all_cities.begin();iter5!=all_cities.end();iter5++)
    if(*street->getStart()==*(*iter5))
    {
    
        }
    
    

Log in to reply