pointers-memory · beginner · ~15 min

Read through a pointer

Read a value via dereference.

Challenge

Implement int deref(const int *p) returning the value p points to.

Starter code

int deref(const int *p) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.