You can't extract a full vector like that.
You have to extract the strings one at a time and insert them into your vector.
So what I exactly have to do?
1 2 3 4 5 6 7 8 9 10 11
|
ifstream fin;
fin.open("address.xml");
vector<string> text;
while(!fin.eof())
{
for(int i= 0; i < text.size(); ; i++)
{
fin >> text.at(i);
}
}
cout << text;
|
try this out
Last edited on
@disch
i tired, and this comes out
error: no match for 'operator>>' in 'fin >> text'|
also how to use cout?
Last edited on
vectors use [brackets] to address their elements, not (parenthesis)
cout << text[i];
Last edited on
Yes, I know. That's not what I typed.
Reread my last post.
EDIT: To clarify.. you need another string, which I named "temp". This is different from your vector, which is named "text".
Last edited on
Finally it works, thank you for the help.