A
aarthi28
Hi,
I am trying to compare 2 vectors of different sizes, and if the same
element exists in both, I want to replace them by the text "aa". I
thought this would work, but it replaces the entire array with just
"aa". I'm not sure how else to do what I want to do
for (unsigned int i=0; i<a_word_list.size(); i++)
{
for (unsigned int j=0; j<n_word_list.size();j++)
{
if (a_word_list.compare( n_word_list[j]))
{
a_word_list.assign(1,"aa");
n_word_list.assign(1,"aa");
}
}
}
I am trying to compare 2 vectors of different sizes, and if the same
element exists in both, I want to replace them by the text "aa". I
thought this would work, but it replaces the entire array with just
"aa". I'm not sure how else to do what I want to do
for (unsigned int i=0; i<a_word_list.size(); i++)
{
for (unsigned int j=0; j<n_word_list.size();j++)
{
if (a_word_list.compare( n_word_list[j]))
{
a_word_list.assign(1,"aa");
n_word_list.assign(1,"aa");
}
}
}