Pointer programs
Are there any programs that beginners can write that help them understand how to work with pointers better? I have done one with a singly linked list, but I was wondering if there are other that could be helpful.
I think making linked list is one of the best pointer related things you can make. If you start trying to use pointers specifically in a project, you will only end up with bad coding habits. Learn how to use them yes... but only use them if absolutely necessary. A linked list probably shows enough understanding of pointers really. You are better spending time learning to use references correctly, and the built in container types (and subsequently the iterators, and STL algorithms).
Writing a templated binary tree class might also be a fun exercise. It will certainly be a good exercise in pointers and recursive processing.
I promise I have no affiliation with the publishers of this book, in case you were wondering, as I seem to be recommending it to everyone, but: this is an excellent book, and he implements a tree class to evaluate functions (for a symbolic calculator). I would say reading this book is a VERY good idea, and given you have a basic grounding in C++, its not going to be too hard going either.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement