Two simple examples of how pointers and arrays relate to each other. These examples make a pointer point to every element of a 2D and 3D array and print their elements in order using pointer arithmetic.
NCN Project, Purdue University
Cite this work
Researchers should cite this work as follows:
David A Saenz (2012), "Playing with pointers in C++," http://nanohub.org/resources/14107.
nanoHUB.org, a resource for nanoscience and nanotechnology, is supported by the National Science Foundation and other funding agencies. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.