Solved: Consider the following function that is intended to swap the values of two
Chapter 5, Problem R5.16(choose chapter or problem)
Consider the following function that is intended to swap the values of two integers:void false_swap1(int& a, int& b){ a = b; b = a;}int main(){ int x = 3; int y = 4; false_swap1(x, y); cout << x << " " << y << endl; return 0;}Why doesnt the function swap the contents of x and y? How can you rewrite thefunction to work cor rectly?
Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.
Becoming a subscriber
Or look for another answer