In "push_back()" you are supposed to input the value which you are adding to the vector.
For example, v.push_back("hello")
Perhaps you were under the impression that the value you put in push_back is the number of new slots being created. I believe your code should look like this:
for (int t=0; t=offspringnumber-1;t++){
string newmutated= mutatedstring(origmutated,rate);
v.push_back(newmutated);
int matchnumber= match(orisentance,newmutated);
v2.push_back(matchnumber);
}
You don't actually have to use "t" inside the for loop since the push_back function automatically sticks the new value on the end.
MareoRaft
Junior Poster in Training
79 posts since Oct 2005
Reputation Points: 10
Solved Threads: 4