C Pointers: What are they and how do you use them?

What is a pointer?

  • If you have a variable ‘var’ in your program, ‘&var’ will give you the address in memory of the variable ‘var’.
  • Pointer variables are special variables that are used to store addresses rather than values.
  • A pointer is a variable that stores the memory address of another variable as its value.
  • A pointer variable points to a data type (like int) of the same type, and is created with the * operator. The address of the variable you're…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store