#include <iostream>
#include <string.h>
using namespace std;
template <class T>
void my_swap(T &a, T &b) {
T aux;
aux = a;
a = b;
b = aux;
}
template <class T>
void my_swap2(T *a, T *b) {
T aux;
aux = *a;
*a = *b;
*b = aux;
}
int main(int argc, char const *argv[]) {
//int a = 12,
// b = 45;
//float a = 12.42,
//b = 45.72;
//double a = 12.123,
//b = 45.65;
//char a = 'x',
// b = 'y';
string a = "adrian",
b = "campanera";
//char *a="Adrian",
//*b="Campanera";
std::cout<<"a="<<a<<"\n";
std::cout<<"b="<<b<<"\n";
//my_swap(a,b);
my_swap2(&a,&b);
std::cout<<"Changed:\n";
std::cout<<"a="<<a<<"\n";
std::cout<<"b="<<b<<"\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnRlbXBsYXRlIDxjbGFzcyBUPgp2b2lkIG15X3N3YXAoVCAmYSwgVCAmYikgewogICAgIFQgYXV4OwogICAgIGF1eCA9IGE7CiAgICAgYSA9IGI7CiAgICAgYiA9IGF1eDsKfQoKdGVtcGxhdGUgPGNsYXNzIFQ+CnZvaWQgbXlfc3dhcDIoVCAqYSwgVCAqYikgewogICAgIFQgYXV4OwogICAgIGF1eCA9ICphOwogICAgICphID0gKmI7CiAgICAgKmIgPSBhdXg7Cn0KCmludCBtYWluKGludCBhcmdjLCBjaGFyIGNvbnN0ICphcmd2W10pIHsKICAvL2ludCAgICBhID0gMTIsCiAgICAvLyAgICAgYiA9IDQ1OwoKICAvL2Zsb2F0ICAgIGEgPSAxMi40MiwKICAgICAgICAgICAvL2IgPSA0NS43MjsKCiAgLy9kb3VibGUgYSA9IDEyLjEyMywKICAgICAgICAgLy9iID0gNDUuNjU7CgogICAgLy9jaGFyICAgICBhID0gJ3gnLAogICAgICAvLyAgICAgICBiID0gJ3knOwoKICBzdHJpbmcgYSA9ICJhZHJpYW4iLAogICAgICAgICBiID0gImNhbXBhbmVyYS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