linked list - How to have your own Node structure in a forward_list in C++? -


how combine own typical typedef node { int data; int data1; node* next} make forward_list ? think can throw away node* next (i.e. typedef node { int data, int data1} ) , make stl manage pointers through forward_list, how delete pointer particular node ? standard iterator on forward_list long int , not node ; if use node create linkedlist, how delete node list ?

i think can throw away node* next , make stl manage pointers

yes should do

how delete pointer particular node ?

std::forward_list::remove std::forward_list::erase_after std::forward_list::remove_if std::forward_list::pop_front std::remove std::remove_if 

give different algorithms delete nodes list

how delete node list ?

follow example in link


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo