int a = 10; int b = 20; int& ref = a; int main() { cout << ref; cout << a; }
这段代码会报错,ref不明确的问题,为什么?a就不会?二者不应该都是全局变量吗?
&多余了