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

What is a ratio? Help please really need the answer helppp!
If you were traveling from Georgia to Arkansas, which direction would you primarily travel?
Why might filmmakers have chosen to produce movies that drew on America's historical past?
The German use of _______ caused tension to increase between the U.S. and Germany. submarine warfare. atomic bombs isolationism rationing
What is the theory that America is a country of different cultures fusing together?
What is the ratio of x to y? 3/5= x/x+2y
Which leader of the Scientific Revolution developed a mathematical coordinate system and emphasized the use of mathematics in all areas? A. René Descartes B. Fr
What is the ratio of x to y? 3/5= x/x+2y
How do u find the approximate radius of a sphere with a volume of 113 cubic centimeters? Explain please
Who saw no personal connection between the gods and individual people? A. Egyptians B. Hebrews C. both