For this question, I needed to determine the final values of all p, q, w, and x after the following program runs. I have
Posted: Sun May 15, 2022 1:13 pm
For this question, I needed to determine the final values of all
p, q, w, and x after the following program runs. I have already
figured out the answers by using a cout statement but I need
help understanding how to actually get the numbers that are output.
Please explain how to trace what is going on so I know how to
determine the answer without using a cout statement.
void main()
{
int p, q, *r, *s;
float w, x, *y, *z;
r = &q;
*r = 13;
p = q;
s = r;
r = &p;
y = &w;
z = &x;
*s += 1;
*y = *s;
*z = *y;
}
p, q, w, and x after the following program runs. I have already
figured out the answers by using a cout statement but I need
help understanding how to actually get the numbers that are output.
Please explain how to trace what is going on so I know how to
determine the answer without using a cout statement.
void main()
{
int p, q, *r, *s;
float w, x, *y, *z;
r = &q;
*r = 13;
p = q;
s = r;
r = &p;
y = &w;
z = &x;
*s += 1;
*y = *s;
*z = *y;
}