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

Which type of galaxy is the Milky Way? 1. Irregular 2. Elliptical 3. Spiral 4. Satellite
what is the deepest part of the ocean called
Is this an anastrophe, "taste well it does?"
Any place inside a hachure line is a _____ elevation than the hachure line. -higher -lower -deeper -longer
This was the outcome of what revolution? Countries achieved their independence from the European monarchies—notably Spain, Portugal, and France—that held power
Which of these was a result of the French and Indian War? A. The European nations were removed from North America. B. The British government encouraged colonist
Because of land lotteries in Georgia, the Creek Indians A) were displaced from their homes and their land. B) moved west to escape the rule of the government.
Symptoms will always be experienced after receiving an STD from an infected partner. (1 point) true false
How did the life of sharecroppers affect their children? Children went to school because the farms were small, with little work. Children had to help work on th
Metabolism requires energy and nutrients. true or false