second class
2016-03-02 15:32
274 查看
#include<iostream> using std::cout;//identifier(名字,标示符) scope(作用域) using std::cin;// using directive(using指令) using std::endl; // pass by value - 传值调用 int add(int x, int y)//形参 {return x+y;} //pass by address- 传址调用 void swap(int *p,int *q) { int temp; // * - temp=*p; *p=*q; *q=temp; } //pass by reference 传引用 void swap2(int &a, int &b) { int t=a; a=b; b=t; } int main(); { int x = 10; int& cx = x; //cx is a reference(引用) to x; cx++; cout<<add(x,cx)<<endl;//argument }
相关文章推荐
- 编程思路感想(1)
- obj-y和obj-m 的区别
- 68.Which statement is true regarding the default behavior of the ORDER BY clause?
- 波段组合OIF指数计算
- 人工智能1:基本概念
- 如何成为好的领导者
- 网页布局基础浅谈
- 用CocoaPods做iOS程序的依赖管理
- WebView无法弹窗的问题。
- 带大三个hybird app项目的设计管理笔记
- mysql服务突然丢失解决方案
- Exchange2013/2016 ECP/OWA无法通过用户验证EventID3002/3005
- java与&或|非~运算
- text-decoration:none; 为什么不生效
- 树莓派配置静态id和dns服务器
- px 与 dp, sp换算公式?
- JS 筛选出1-100间的素数
- 《chkconfig核心案例和核心原理》
- iOS-银行卡四位数分隔效果
- c++第一次上机实