Let’s Make Pointers Easy to Understand
When learning C, the concept often cited as the most difficult is the Pointer. In this post, I want to explain pointers in a way that is…
Let’s Make Pointers Easy to Understand
When learning C, the concept often cited as the most difficult is the Pointer. In this post, I want to explain pointers in a way that is simple, straightforward, and easy to grasp!

Photy by Nikolay Loubet on Unsplash
It’s Just Another Data Type
When we declare a variable, we specify a data type. For example, we use int for integers and double for floating-point numbers. Pointers are no different.
You can think of a pointer as just another data type, like
intordouble.
If that sounds a bit confusing, let’s look at a standard variable declaration first:
int age = 20;
This means we are storing the value 20 in an int type variable.
char grade = 'a';
This means we are storing the character 'a' in a char type variable.
Just like these, when you define a pointer variable, it simply means you are storing a memory address as its value.
A Closer Look at Memory
Let’s go back to int age = 20;. When this is defined, the value 20 is stored in the actual physical memory of the computer. The variable age acts as a label for the specific memory address where that 20 is kept.
This is why we can simply use printf("%d", age); without manually specifying a memory address. Because age points to the address where the value 20 lives, the system knows exactly where to go to get the data.
How can we prove that age is linked to a memory address? We use the & (address-of) operator:
int age = 20;
printf("%p", &age); /* Example Output: 0x0ff46200 */
While the actual numbers will vary every time you run the code, this confirms that the age variable is tied to a specific spot in memory.
Declaring a Pointer Variable
Now, let’s declare a pointer. To turn a regular variable into a pointer variable, we simply add an asterisk (*).
int age = 10;
int *pAge = &age; // This is a pointer variable
By doing this, we are storing the memory address of age into the pointer variable pAge. Let's compare them:
int age = 10;
printf("%p", &age); /* Example: 0x53cd1400 */
int *pAge = &age;
printf("%p", pAge); /* Example: 0x53cd1400 */
See? The address held by age and the value stored in the pointer pAge are identical.
Dereferencing: Getting the Real Value
Now we know that a pointer refers to a memory address. But how do we get the actual value stored at that address? Accessing the real data through an address is called dereferencing.
printf("%d", *pAge); /* Output: 10 */
By placing the * in front of the pointer variable pAge, the program goes to the memory address being referenced (e.g., 0x53cd1400) and retrieves the value stored there (10).
Here is the full picture:
int age = 10;
printf("%d", age); /* 10 (Direct access) */
printf("%p", &age); /* 0x53cd1400 (The address) */
printf("%d", *&age); /* 10 (Accessing the value via the address) */
Summary
In the end, a pointer isn’t some magical mystery. Just as an int stores integers and a char stores characters, a pointer is simply a data type that stores a memory address.
메타데이터
- post_id
- 62d2b5877cb7
- slug
- lets-make-pointers-easy-to-understand-62d2b5877cb7
- url
- https://medium.com/@su_bak/lets-make-pointers-easy-to-understand-62d2b5877cb7
- canonical_url
- https://medium.com/@su_bak/lets-make-pointers-easy-to-understand-62d2b5877cb7
- author_url
- https://medium.com/@su_bak
- status
- ok
- fetched_at
- 2026-06-20 20:29:01