Hi I keep trying to run this procedure in my program, however it keeps telling me that it is calling a vector index out of bounds and im getting extremely frustrated as to why it is doing this. Any help would be greatly appreciated!
Thanks,
I attached the code for the procedure as well
void merge(vector <string> & songs1, vector <string> & artists1,
vector <int> & ratings1, vector <string> & songs2,
vector <string> & artists2, vector <int> & ratings2)
{
bool not_dupl = true;
for(int i = 0; i < songs2.size(); i++)
{
for(int j = 0; j < songs1.size(); i++)
{
not_dupl = false;
if((songs2.at(i) != songs1.at(j)) and (artists2.at(i) != artists1.at(j)))
{
//adds songs to playlist
not_dupl = true;
}
}
if( not_dupl == true)
{
songs1.push_back(songs2.at(i));
artists1.push_back(artists2.at(i));
ratings1.push_back(ratings2.at(i));
cout << songs1.size() <<' ' << songs2.size() << endl;
}
}
return;
}