Question: I have a question about this program and how to address a value that is stored in a memory location, using the dereference operator, and

I have a question about this program and how to address a value that is stored in a memory location, using the dereference operator, and printing those values in the addresses stored in 2 variables p and q as those variables are addressed to x and y. 

 

Below is a picture of my code. When I compile I get a bunch of error messages, is there anything that needs to be fixed that you can spot? The comments is what the code below each block is supposed to do. 

/** ---create a C program to do the following in the orderlisted--- ** / #include #include int main() { // create a two

/** ---create a C program to do the following in the order listed--- ** / #include #include int main() { // create a two integer variables, x and y int x= 100; int y = 50; // create two pointers to integers, p and q int* p; int* q; // print the addresses of all four variables...for addressing a value that will be printed is & needed within the print statement printf("The address of x: %d", &X); printf("The address of y: %d", &y); printf("The address of p: %1x", &p); printf("The address of q: %lx", &q); // print the values stored in all four variables printf("The value of x: %d", x); printf("The value of y: %d", y); printf("The value of p: %1x", p); printf("The value of q: %1x", q); // setting p to the address x, and q to the address y int p = &x; // pointer "p" now points to int x int q = &Y; // print the address of all four variables (as before) printf("The address of x: %d", &x); printf("The address of y: %d", &y); in+5mb

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are a few issues I noticed in your code 1 Missing assignment operator in variable declarations ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!