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 7/12 subtracted by 1/8?
Name the region of the atom where protons and neutrons are located. This region is indicated by label B.
(11) Amber has a dog walking business. She walks the golden retriever 1.8 miles each work day for a week. How many miles does Amber walk the golden retriever?
0.02 is 1/10 of 0.2. True or false ??
some people think all the names have special meanings what do you think tell about it using example if you can ​
Help somebody please
If Einstein had never come up with E=mc2, would we know anything about gravity
One purpose of contract law is to determine which agreements are worthy of legal enforcement.
Time management is one of the keys to success as a college student! You can do a number of things to maximizethe time you have in a day.Choose ONE of the strate
A solid figure has 2 flat surfaces. 1 curved surface, no edges and no vertices. Name this soild figure