Question: Write a C program to produce the following output so as to demonstrate pointers usage. Specifically, in the program, create two integer variables m and

Write a C program to produce the following output so as to demonstrate pointers usage. Specifically, in the program, create two integer variables m and n, and two pointers, pm pointing to m, pn pointing to n. Print out their values and address as following (...the address on your run would be different): Address of m : 0x7ffcc3ad2910 Value of m: 29 Address of n : 0x7ffcc3ad2910 Value of n : 34 Now pm is pointed to m by assigning the address of m to pm Address of pointer pm: 0x7ffcc3ad2100 Value of pointer pm: 0x7ffcc3ad2910 Content of pointer pm (dereferencing): 29 Now pn is pointed to n by assigning the address of n to pm Address of pointer pn: 0x7ffcc3ad2101 Value of pointer pn: 0x7ffcc3ad291d Content of pointer pn (dereferencing): 34
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
