← Pointers: What They Actually Are

Read Through a Pointer

easy

p already points at x (that’s what int *p = &x; set up). Print x’s value two ways: directly by name, and by dereferencing p. They should always match – *p and x refer to the exact same box in memory, just spelled differently.

This exercise doesn’t ask you to change anything yet – it’s just confirming, with real input instead of a fixed example, that reading through a pointer really does give you back the pointee’s value.

Your solution

"Run" uses the sample stdin ("17"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution