Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void swap( int *, int *);
- int main()
- {
- int m = 10;
- int n = 20;
- cout << m << " " << n << endl;
- swap(&m, &n);
- cout << m << " " << n << endl;
- system("PAUSE");
- }
- void swap (int *m, int *n)
- {
- int temp;
- temp = *n;
- *n = *m;
- *m = temp;
- }
Add Comment
Please, Sign In to add comment