用传地址方法交换两个变量的值
来源:互联网 发布:复杂网络建模软件 编辑:程序博客网 时间:2024/04/27 22:55
#include<iostream>
using namespace std;
void swap(int *,int *);
int main()
{
int a=5;
int b=10;
swap(&a,&b);
cout<<a<<endl<<b<<endl;
return 0;
}
void swap(int *a,int *b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
- 用传地址方法交换两个变量的值
- 交换两个变量的值的方法
- 两个变量的值的交换方法
- 两个变量交换值的方法
- 不用中间变量,交换两个变量的值的方法
- 两个变量不用中间变量交换值的方法
- 不使中间变量交换两个变量的值方法
- 交换两个变量方法
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- 交换两个变量的值
- Python的学习(十六)----脚本发送邮件
- 如何快速处理[解决]一个bug
- ubuntu下C/C++基本开发环境的配置
- 代码修改Webservice的地址,支持同步和异步方式
- jqGrid与Struts2的结合应用(二) —— 操作Grid数据
- 用传地址方法交换两个变量的值
- android开发之——混淆编译
- 终于能写了
- 基于 Struts2 标签的 BigPipe 技术实现
- 【windows8开发】开发平台与开发框架
- Java类集 _集合工具类:Collections
- research plan (En)
- 算法导论 之 快速排序[C语言]
- 股票只有两个字:“等待”