任务
- 设计一个函数my_swap,实现两个数的交换,请分别使用指针和引用进行实现
- 请修复下面程序中的错误
#include <iostream>
using namespace std;
void change(const int &a)
{
a ++;
}
void printf_string(string str)
{
cout << "str:" << str << endl;
}
int main(void)
{
int a = 10;
change(a);
cout << "a = " << a << endl;
string str = "hello";
printf_string(str);
printf_string("world");
return 0;
}