Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void swap(int &x, int &y)
- {
- }
- int main()
- {
- int x=5;
- int y=10;
- int& r_y = x;
- int& r_x = y;
- cout << "Vorher: x= "<< x << " y = " << y << endl;
- swap (x,y);
- cout << "Nachher: x= "<< r_x << " y = " << r_y << endl;
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement