Where Can We Use Pointers In C++?


1 Answers

Anonymous Profile
Anonymous answered
Pointers are most often used in linked lists.

for clarification: There are two types of pointers, using the symbols "*" and "&", "*" points to a value (example, 'tennis ball') and "&" points to a reference (eg, "the tennis ball is in this box")

a linked list is simply a data structure that lets you keep a bunch of things organized. For example, you might have, say, a word- a list of characters- as one "node" of the list, and then a pointer at the end of the node, pointing to the next word, so that you can read it out as a sentence.

real-life uses include things such as search trees, circular linked lists are used for buffering streaming video, dictionaries (the book or tool, not the code object) can be implemented with linked lists to do things like spell checking, etc.

linked lists are one of the most useful data structures, and are used for virtually everything, but to understand them, you need to know how to use pointers, so read up on this, play with the code, and really make sure you understand this.

Answer Question