Line 43 - Shouldn't you be using insert or push_back to add an item to a vector?
Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
If you had specified a size for the vector in main, what you did could work, but since it starts off with an unspecified size you can't index into it.
string tempstring;
while(i < MAX && in >> tempstring)
{
str.push_back(tempstring);
i++;
}
You should also pass the vector in by reference in order to change it within any of the functions.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581