Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void swap(int* x, int* y)
- {
- int temp = *x;
- *x = *y;
- *y = temp;
- }
- int main()
- {
- int x;
- int y;
- cin >> x;
- cin >> y;
- int* a = &x;
- int* b = &y;
- swap(a, b);
- cout << x << endl << y;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment