-3

Possible Duplicate:
Iteration over vector in C++

I'm just trying to figure out how to loop through two vectors and compare data. Writing a program that will take correct quiz answers and compare to student answers to determine if they are correct. I'm confused with using iterators and how to apply them in this situation. Can anyone help? Thanks!

Community
  • 1
  • 1
Selli S
  • 175
  • 1
  • 2
  • 10

1 Answers1

1
std::vector<int> students=get_selections(); //or whatever
std::vector<int> correct=get_cor...

bool is_equal=std::equal(students.begin(), students.end(), correct.begin());
111111
  • 15,686
  • 6
  • 47
  • 62