1️⃣

1.1 What are Pointers, and why do we use them?

 

What are Pointers?

When you hear the word “pointers”, the first thing to come to mind is probably a finger, but in C, that’s not what they are. Pointers are defined as “a variable which stores the address of another variable”. In more direct terms, Pointers save the memory address of a variable. A memory address is what the actual computer sees the variable as - a random assortment of numbers and letters.
 

Why do we need Pointers?

Pointers save memory space. You might be thinking - “Why do I care?”. Saving memory space results in faster run times. Pointers are pretty rare, and C is one of those few languages that offers them. You can also use the memory data to condense code.

Next Section

 
⚖️
Copyright © 2021 Code 4 Tomorrow. All rights reserved. The code in this course is licensed under the MIT License. If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.