Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void swap(int *a, int *b) {
- return;
- }
- void swap(int &a, int &b) {
- return;
- }
- int main() {
- int a, b;
- std::cin >> a >> b;
- std::cout << a << ' ' << b << '\n';
- swap(a, b);
- std::cout << a << ' ' << b << '\n';
- swap(&a, &b);
- std::cout << a << ' ' << b << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement