Стиль C ++ 11:
void print(const vector<Student>& students) { for(auto const& student : students) { cout << student.name << endl; } }