// I have a vector because that is where I stored the file I read
ostream& operator << (ofstream& out, vector<Inv>& V)
{
vector<Inventory>::iterator vIter;
for (vIter = V.begin(); vIter<V.end(); vIter++)
{
out << vIter->name << " " << vIter->price
}
return out;
}
// now how do I call this in main() or anothe function()
int main()
{
vector<Inv> V;
cout << V;// why wont this work??
}
// or
void something(vector<Inv>& V)
{
cout << V;// why wont this work??
}
I hope I amking it kind of clear where my confusion is.