I am trying to increment 2 variables in a for loop and i want the loop to exit when the highest value variable is reached
My example a gets the first element of a vector and f gets the next. It needs to keep doing that until f reaches the last vector and a gets the first from last vector
If i take it out the loop and put values in the vec.at() i get a value
There are my values
vec.push_back("!");
vec.push_back("=");
vec.push_back("and");
vec.push_back("bee");
vec.push_back("=");
vec.push_back("=");
vec.push_back("car");
and this is my code example
for(int a=0, f=0; a < vec.size(); a++)
{
f++;
if(f < vec.size())
{
rel1 = vec.at(a);
rel2 = vec.at(f);
vector<string> relation = JoinRelation(rel1, rel2);
}
}
at the moment nothing is getting output or saved in a new vector so it is the for loop causing problems