Exercise 1: Introduce int variables x and y and int* pointer variables p and q. Set x to 2, y to 8, p to the addre
ss of x, and q to the address of y. Then print the following information:
(1) The address of x and the value of x.
(2) The value of p and the value of *p.
(3) The address of y and the value of y.
(4) The value of q and the value of *q.
(5) The address of p (not its contents!).
(6) The address of q (not its contents!).
Use the Hex function to print all pointer/address values and format the output so it is easy to make comparisons.

ctaylo21 commented: Don't just post your homework questions. +0

Doesn't sound like you want help with pointers, but more you want us to do your homework!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.