常量引用的两种方式。

#include<iostream>
using namespace std;

int main()
{
	
	const int &i = 1;
	cout << i << endl;
	int &&b = 2;//右值引用
	cout << b << endl;
	while (1);
	return 0;

}

#笔经#
全部评论
还是有区别的,在内存中存储的位置有区别
点赞 回复 分享
发布于 2022-03-22 15:41

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务