内联函数,没有牺牲内存空间而去提高运行速度!应该是类似移动插入,当执行到调用函数时候,该函数是内联函数,这时候就把该函数的函数代码直接插入到该调用代码位置!
2015-10-30
# include <iosstream>
useing namespace std;
ina main ()
{
int x = 3;
int &y = x;
count << x << ","<<y<<endl;
y = 13;
count << x << "," << y << endl;
return 0;
}
useing namespace std;
ina main ()
{
int x = 3;
int &y = x;
count << x << ","<<y<<endl;
y = 13;
count << x << "," << y << endl;
return 0;
}
#include <iostream>
using namespace std;
int main(void)
{
int x = 3;
//定义引用,y是x的引用
int &y=x;
//打印x和y的值
cout << x <<"," <<y <<endl;
//修改y的值
y = 10;
//再次打印x和y的值
cout << x<<","<<y <<endl;
return 0;
}
using namespace std;
int main(void)
{
int x = 3;
//定义引用,y是x的引用
int &y=x;
//打印x和y的值
cout << x <<"," <<y <<endl;
//修改y的值
y = 10;
//再次打印x和y的值
cout << x<<","<<y <<endl;
return 0;
}