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

A cyclotron is designed to accelerate protons (mass 1.67 x 10^-27 kg) up to a kinetic energy of 2.5 x 10^-13 J. If the magnetic field in the cyclotron is 0.75T,
Part of the tooth covered with enamel.
Any size group of interacting parts that form a complex whole is
A car is designed to get its energy from a rotating flywheelwith a radius of 1.50 m and a mass of475 kg. Before a trip, the flywheel isattached to an electric m
simplify the ratio 18:30​
What do think the possible reason that Islam didn’t spread to more areas in Europe
What is 1000 kJ/sec in watts?
Calculat the acceleration of a person at latitude 40degreesowing to the rotation of the earth.
Compute the fundamental natural frequency of the transverse vibration of a uniform beam of rectanqular cross section, with one end of the beam is free and one e
Which is the best definition of family planning? A. studying a variety of forms of birth control to avoid pregnancy when someone is too young to raise a child B