Values & References3 / 16
Up next

Pointers hold addresses

#include <print>

int main() {
    int n = 42;
    // p stores the address of n
    int* p = &n;
    // * reads or writes through the pointer
    *p += 1;
    std::println("{}", n);
}
What you're solving

* dereferences, & takes the address