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

During World War II, what happened between the Communists and Nationalists in China?
A common rule is that housing expenses plus other debt payments should not be more than 36% of your monthly income. Your monthly income is $4,300, and you have
one half hour past midnight. write the time using a.m or pm. and one half hour after 4:00 in the morning
Only 6 of the 75 is a park are at least 30 feet tall .what percent of the trees are under 30 feet tall
Because of their function, we would expect muscle cells to have a large number of which cellular organelle?
What purpose should a well-crafted plot serve? A. Create a story that is well known B. Show us the biases of the author C. Keep the story moving forward D. Make
George washington's farewell address gave a strong message about foreign policy what was it
How did the strong economy that emerged during the Reagan years affect social change in the 1980's?
What is 9 1/6 minus 3 5/8?
A woman is 5 1⁄7 inches taller than her daughter. The woman is 66 1⁄7 inches tall. How tall is her daughter?