[求助]请教访问隐藏名称的问题
大家好,我在看c++的书的时候,用::访问隐藏的名称,却总是编译出错,提示“has not been ceclared”,请问一下是哪里错了或该如何解决#include <iostream>
using std::cout;
using std::endl;
int main() {
const int limit=10;
cout<<"outer limit is "<<limit<<endl;
{
const int limit=5;
cout<<"inner limit is "<<limit<<endl;
for(int i=1; i<=::limit; i++) //这一行不能通过编译
cout<<endl<<i<<"squared is "<<i*i;
}
cout<<endl<<endl<<"last limit is "<<limit<<endl;
system("pause");
return 0;
}