I'm trying to compare 2 strings by "==" operator. when i print the string both are identical.
but length of one is bigger by one, i figured it is the null terminator.
any way to ignore this when comparing??
Thanks!!
City* Adjutancy::FromStringToCity(string cityName) const
{
for (list<City*>::const_iterator it=m_citiesList.begin();it!=m_citiesList.end();it++)
if ((*it)->GetCityName()==cityName) //this fails
return *it;
return NULL;
}
and
string GetCityName() const {return m_cityName;}
creation
private:
string m_cityName;
and
FromStringToCity(toAdd->GetCityOfBase());
and
string Base::GetCityOfBase() const
{
return m_baseCity;
}
and
private:
string m_baseCity;
This is all, BTW this works on Visual Studio in windows, but now when I transfer it to Linux Kate - this where it fails.