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

On Tuesday, Donovan earned $9 for 2 hours of babysitting. On Saturday, he babysat for the same family and earned $31.50. How many hours did he babysit on Saturd
Which one is greater 0.64 or 7over 10
How is 18.089 written word form
use the word aqueduct in the sentence about Tenochtitlan plz help cause I don't know a sentence about this stuff
What is the S phase? What happens during this phase?
A wave has a period of 2 seconds and a wavelength of 4 meters.Calculate its frequency and speed.
Which quadrilateral does NOT always have congruent diagonals? Why? I know it is a rhombus but i dont know why. someone please help!
What was the purpose of the Titanic's inner hull?
What is a good thesis statement about online dating? I think it's a bad idea I have to compare and contrast Help?
A major characteristic of the Anasazi culture in what is today the U.S. Southwest was (A) the building of large mounds for burial grounds (B) potlatch ceremonie