Skip to content
Justice Tech School

Pointers

A pointer stores the memory address of another variable. & gives an address and * (dereference) reads or writes the value at an address. Pointers let functions change the caller's variables.

Example
int x = 10;
int *p = &x;
*p = 25;
printf("%d\n", x);
printf("%d\n", *p);
printf("%d\n", p == &x);

Result

25
25
1

Exercise

Read the value a pointer points to.

int v = p;

Quiz Test

What does & give you?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.