Overload operator++ for a linked list -



Overload operator++ for a linked list -

i trying overload ++ operator utilize in loop move next object in linked list. example:

for(pcurrent = pheader; pheader->m_next != null; ++pcurrent) { if (p_current == search_value){ dosomething(pcurrent); break; }

i'm not sure how overload ++ operator. i've tried this:

const node& operator++(node* p_node){ p_node = p_node->p_next_node; homecoming p_node; }

linked-list operator-overloading nodes

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -