The error is:
error: no match for âoperator==â in â((University*)this)->University::departments.std::vector<_Tp, _Alloc>::operator[] [with _Tp = department, _Alloc = std::allocator<department>](((unsigned int)i)) == depIdâ
- Your 'departments' vector is of type std::vector<department>
- This means departments[i] is of type department
- I'm guessing your depId is not of type department but is an integer or something.
You can't compare an integer to a department. You probably meant to do this: