Problem with a function....scope
Ok, I should probably just wait and look at it again tomorrow before posting this because I know I should be able to figure it out. But.......
I get the error " 'fail' undeclared " It is declared in the extract_fails function and I realize it is out of scope in main() but I can't figure out to get it to work. Shouldn't I be able to reference it somehow. I have posted only the extract_fails() and the relevent portion of main(). If more is needed, I'll post the rest.
Thanks. I hope my question is clear...I'm getting cross-eyed.
// include files........
vector<Student_info> extract_fails(vector<Student_info>& students)
vector<Student_info> pass, fail;
for (vector<Student_info>::size_type i = 0;
i != students.size(); ++i)
students = pass;
// more code here (students and grades being entered)
vector<Student_info> fail; //edit: oops. not in the code
for (int i = 0; i != fail.size(); ++i) //list failing students
cout << endl << fail[i].name;