DarkAlchemist
Programmer
This is what I came up with but it refuses to compile can anyone tell me what is wrong?
class Country
{
public:
std::string CountryName;
std::string PersonsName;
std::string Coords;
};
std::vector <Country> places;
Country d;
int main(int argc, char* argv[])
{
d.CountryName = "USA";
d.Name = "Joe Smyth";
d.Coords = "10.0N 20.4W";
places.push_back(d);
std::vector<string>::iterator begin = d.Coords.begin();
std::vector<string>::iterator end = d.Coords.end();
std::vector<string>::iterator my_iterator = std::find(begin, end, "10.0N 20.4W"
;
return 0;
}
The iterator sections are the ones with the problems. What I want to do is find a match on the coords then I can grab the rest of the record. The way I had been doing it was to have 3 vectors. Btw, I do wish to use a vector not a list or a map.
Thank you.
class Country
{
public:
std::string CountryName;
std::string PersonsName;
std::string Coords;
};
std::vector <Country> places;
Country d;
int main(int argc, char* argv[])
{
d.CountryName = "USA";
d.Name = "Joe Smyth";
d.Coords = "10.0N 20.4W";
places.push_back(d);
std::vector<string>::iterator begin = d.Coords.begin();
std::vector<string>::iterator end = d.Coords.end();
std::vector<string>::iterator my_iterator = std::find(begin, end, "10.0N 20.4W"
return 0;
}
The iterator sections are the ones with the problems. What I want to do is find a match on the coords then I can grab the rest of the record. The way I had been doing it was to have 3 vectors. Btw, I do wish to use a vector not a list or a map.
Thank you.