引用

来源:互联网 发布:潜在因子推荐算法 编辑:程序博客网 时间:2024/05/18 05:22

1)引用初始化右值是变量

int a=100;

int &b=a;

2)引用如果右值是常量时,要用const T&

int &a=100;错误

const int &a=100;//正确


http://blog.163.com/toplcx@yeah/blog/static/92667383200991210466376/

0 0