joeanderson4959 joeanderson4959
  • 15-08-2019
  • Computers and Technology
contestada

The variables xp and yp have both been declared as pointers to integers, and have been assigned values. Write the code to exchange the two integers

Respuesta :

cdw2014
cdw2014 cdw2014
  • 15-08-2019
The question is asking us to swap the values of xp and yp while not changing where they point to. Setting xp equal to yp would not work because then we couldn't change yp since the value for xp was overwritten. We can use a third variable to swap them.

int zp = xp;
xp = yp;
yp= zp;
Answer Link

Otras preguntas

In some contests, the prizes are randomly distributed, but there may be more of one kind of prize than another. Suppose there are 250 tickets in a raffle. There
Which claim is MOST supported by evidence in the article? A Many people mostly avoid lying because they value honesty. B People who lie a lot tell lies because
Explain the formation process of a mid ocean island from a hot spot to an atoll
How old was Abigail when she got caught "fortune-telling" with the other girls? (Deduce this from her birthdate.) I
round 0.6666 to 3 sf
Find the real or imaginary solutions of the equation by factoring. 8 x³=1 .
Use the following passage to answer the question. (1) Water is something most of us take for granted. (2) If we need a cold drink or want to take a shower, wat
He common mud turtle experiences relatively uniform mortality rates throughout its life. it exhibits type _____ survivorship. ii i iii
What is the main limitation of flame tests
Once metabolized, trenbolone increases ammonium ion uptake in the muscle tissue. how does this promote?