Do you mean creating a new vector to contain matching elements, if so
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/// create a vector
vector<string> match;
for (vector<string>::iterator i = ingredients.begin(); i!= ingredients.end(); i++)
{
for (int b=0;b<3;b++)
{
if (*i==pizza[b])
{
/// *i.push_back (pizzamatch); // what is this pizzamatch , you can't call push_back on an
/// iterator
match.push_back (*i);
}
}
}
You can now use vector match for what you intended