Not clear why would you want to compare 2 vectors (it's a sequential container) but...
First compare the sizes of them if that matches Write a for loop and compare element by element.. !
Actually i'm working on a set of data where i need to count every string i have which is located in the vector. In order to count each data i need to compare all of them and start counting for the similarity of data. For example;
In my vector, the data
{"0023", "0002", "0045", "5568"}
{"0023", "0002", "0030", "5550"}
What i need to do: firstly chose the 1st data from the first string, put it into the next vector. Then from there, i need search this data in the second string in the previous vector. If i found the same data, count it.
You can check my code if you want to. Something wrong..
string TempExam;
while(i <TempStudentVec.size())
{
ExamIter = StudIter[i].Exam.begin();
TEMPLarge.NoOfStudent=0;
if(StudIter[i].Exam.size())
{
TempExam = ExamIter[0];
TEMPLarge.Exam.push_back(TempExam);
TEMPLarge.NoOfStudent++;
StudIter[i].Exam.erase(StudIter[i].Exam.begin());
j=1;
while(j < TempStudentVec.size())
{
ExamIter2 = StudIter[j].Exam.begin();
k =0;
while (k<StudIter[j].Exam.size())
{
if (ExamIter2[0] == TEMPLarge.Exam)
{
TEMPLarge.NoOfStudent++;
............................
}