Creating singly linked list

Is there any way to work with linked lists without writing the CreateList() function every single time?
I'm having a really hard time understanding this chapter. I feel like I've spent too much time on it, yet I know too little.
What pisses me off is that I understand how they work, yet I always get the code wrong.
Do you know a good tutorial so I can finally move on?

Do you realize that we don't have "this chapter" under our nose?
@keskiverto What do you mean? By "this chapter" I meant everything about linked lists.
"This chapter" sounds like you are reading a book that has a chapter about linked lists.

"Writing the CreateList() function" sounds like someone (or thing) told that linked lists have such function and you are rewriting code for each project rather than reusing what you already have.

The std::forward_list is a singly linked list that someone else has written, that can be used without rewrite, and that does not supply function named "CreateList()".

Bjarne Stroustrup's presentation about linked lists is entertaining and educational:
https://www.youtube.com/watch?v=YQs6IC-vgmo


Question is, do you understand enough about the concept so that you can you can use one when you need one?
(The devil is in the details with lists, trees, graphs, or just pointers.)
Thank you! I understand the concept, the logic behind them. I could definitely tell if it would be better to use a list over other data structure in order to solve a problem. I guess I just have to spend more time on them.
Topic archived. No new replies allowed.