Q:

Given that p1 and p2 point to elements in the same array, what does the following code do? Are there values of p1 or p2 that make this code illegal

0

Given that p1 and p2 point to elements in the same array, what does the following code do? Are there values of p1 or p2 that make this code illegal?

p1 += p2 - p1;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The code move `p1` to `p2`, it is the same with `p1 = p2`.

Any values are legal as long as both `p1` and `p2` point to elements in the same array.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now