I am getting this error when running:
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr
problem is in this part of code but i brand new and i don't understand how i should solve this problem. content is my vector of strings.
int i=1;
std::string v1, v2, weight;
while(!content.empty())
{
v1 = content[i].substr(2,1);
v2 = content[i].substr(5,1);
weight = content[i].substr(8,1);
i++;
}