接notes 4
cout <<ref<<endl; 会输出10
test02()=20; //函数返回值的引用作为左值
cout <<ref<<endl; //会输出20,因为ref和test02其实都是全局变量a的引用,指向的是同一处内存。
本文标题:cpp notes 5
本文链接:https://www.haomeiwen.com/subject/ngrdhdtx.html
网友评论