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

8,473,227 to rhe nearest 100,000
How are premier and circumstances the same
In the space below, write a 500-word essay describing the theme of O. Henry’s “The Gift of the Magi” (click here to read the short story). Explain how the autho
Why do you think Dreiser wrote "My Brother Paul?" What is he attempting to say by writing about his brother?
Why is angle h congruent to angle k
If 2 pizzas cost $16.22, how much will 6 pizzas cost as a unit rate
In at least 150 words, identify the theme of Chang’s “Garden of My Childhood,” and explain how the poet uses metaphor and personification to convey that theme.
Help please don’t understand.
by w.h Auden what is the response of the people who see icarus into the sea
If LN = 6x-5, LM = x+7 and MN = 3x+20 find MN