Pointers and addresses.
Understand an address as a typed way to refer to an existing object.
The idea behind the syntax.
A pointer value identifies an object or function, or holds a null pointer value meaning it identifies none. The type of a pointer says what kind of object may be accessed through it. & obtains the address of an object, and * applied to a valid object pointer accesses the pointed-to object. These operators are compact, but the important questions are whether the pointed-to object exists, whether access is allowed, and whether its type matches.
A pointer is not ownership by itself. It may point to an automatic local object, a static object, an array element, or dynamically allocated storage. Those targets have different lifetimes. Copying a pointer copies the address-like value; it does not duplicate the target. If two pointers refer to the same object, a change through one can be observed through the other, subject to the language's access and sequencing rules.
What C guarantees.
The null pointer constant can initialize a pointer that deliberately points nowhere. Test such a pointer before dereferencing it. A pointer to const int allows the value to be read but not modified through that pointer; an int * allows modification of a compatible non-const object. const on the pointer itself is a separate declaration choice. Reading declarations from the identifier outward helps distinguish those two meanings.
A function can receive a pointer to let it modify a caller's object. The pointer parameter itself is still passed by value, but dereferencing it reaches the original object. The example changes a scalar through a pointer and checks for null before access. In a real API, a null argument might be rejected, treated as optional, or guaranteed absent by its documented contract; the choice must be explicit.
Why the detail matters.
The value of a pointer is meaningful only together with its target type and target lifetime. &score produces an int * that can identify score while score exists. Dereferencing it reads or writes the same int object, not a second copy. A pointer may later become dangling if the target's lifetime ends. The bits left in the pointer variable do not extend that lifetime, and comparing or dereferencing a stale pointer is not a way to discover whether its target survived.
The pointer itself is also an object when stored in a variable. In add_bonus, the parameter score is a local pointer object initialized from the argument's pointer value. Reassigning score would only change the local pointer, while *score changes the pointed-to int. This two-level picture prevents a common confusion about call by value. For APIs, document whether null is accepted and whether the callee may retain the pointer after returning.
See the rule in context.
#include <stdio.h>
void add_bonus(int *score, int bonus) {
if (score != NULL) *score += bonus;
}
int main(void) {
int score = 12;
add_bonus(&score, 3);
printf("Score: %d\n", score);
return 0;
}main creates score with value 12 and passes its address to add_bonus. The function receives a copy of that pointer, tests it, then dereferences it to update the original score object. The updated value is 15, so main prints Score: 15. No second int object replaces score; the change occurs through another access path to the same object.
Where the rule stops.
A non-null pointer is not necessarily valid. It may be dangling, incorrectly typed, or point outside the object a function assumes. A null check handles only one failure mode.
Keep this model.
Pointers become especially useful with arrays because the array's first element can be addressed and traversed. The next chapter makes the arithmetic rules precise and shows why an address plus a count is the real interface.