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

Convert 2900mm to inches
in which room in the house does one " poner la mesa"
the area and perimeter of a 15.5 x6x8x5 trapezoi
Explain in detail how exercise programs and sports activities can differ in number of participants, structure, competition level, and skill level.
what is a theme of a cub pilot
Matt has 3 cherry pies and 2 apple pies. He wants to share each type of pie equally among 4 different families. How much of each type of pie will each family ge
what is the square root of 54
How can I write 6 over 10 as a terminating decimal
Rachel invested $15,000 in a nine-year CD giving 8.5% interest, but needed to withdraw $4,000 after two years. If the CD's penalty for withdrawal was six months
the first floor of marcus’ house is 1,440 square feet. he will cover 1,033 square feet with wood and the rest with tile. a box of tiles will cover 11 square fee