Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void swap(int *a,int *b)
- {
- int c=*a;
- *a = *b;
- *b = c;
- cout << a << b << endl;
- }
- int main()
- {
- int a = 1,b = 2;
- swap(&a,&b);
- cout << &a << &b << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment