DEV Community

Austin Williams
Austin Williams

Posted on • Updated on

A Quick and Dirty Primer to Pointers in C/C++

Note: This is not meant to teach you how everything works under the hood. This is just for understanding the syntax of pointers and for giving good intuition on how to read and write code which utilizes them.

I was going through some old notes and found a bunch of stuff I wrote about pointers and remembered I had an account on here and figured "why not throw something out there", so here ya go.


Pointer: A variable which holds the address of another variable.
Reference: Setting a pointer to equal the address of a variable.
De-Reference: Reading or Writing to the value at the address pointed to by a pointer.


Modifying a variable via pointer

Passing by Reference vs Passing by Value

Pointers to Pointers

Pointer Arithmetic

Quick Note About Multiple Pointers in One Line

References Used

In Closing

There you go.
This was pretty fun to write up. Maybe I'll do some more little
primers like this. Hopefully someone found it useful, as
this is all admittedly pretty elementary.

Top comments (0)