Good day.
We have this exercise wherein we edit and delete stuff from a list. So far, i've done the editing part but i cant seem to understand how the syntax for list:erase works.
Here's my code for the deletion function:
My problem lies within the for-loop. to be exact, it's this part:
dev-c++ gives me these two notes regarding that part:
note C:\Dev-Cpp\include\c++\3.4.2\bits\list.tcc:96 candidates are: typename std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::erase(std::_List_iterator<_Tp>) [with _Tp = Student, _Alloc = std::allocator<Student>]
note C:\Dev-Cpp\include\c++\3.4.2\bits\list.tcc:96 std::_List_iterator<_Tp> std::list<_Tp, _Alloc>::erase(std::_List_iterator<_Tp>, std::_List_iterator<_Tp>) [with _Tp = Student, _Alloc = std::allocator<Student>]
i've tried removing the asterisk from the iterator (i.e. deletion = w) and also tried to copy the syntax of the example from
list::erase C++ (w = input.erase(w)) but sadly both of them didnt work.
im sorry if this looks like a rookie question. the lecturer's approach was more hands on based. he didnt lectured much, just gave exercises for us to do and answered any questions we have. currently, im depending more on the internet and books (i.e. self-study).
any help is appreciated.