求教关于数组定义的一个小疑点

求教关于数组定义的一个小问题
代码一:
#include <iostream>

using namespace std;

const int max=10;

int main()
{
/*
   * 测试代码,仅定义一个数组,啥也不做。
*/
int array[max];

return 0;
}


代码二:
#include <iostream>

using namespace std;

int main()
{
/*
   * 测试代码,仅定义一个数组,啥也不做。
*/
const int max=10;
int array[max];

return 0;
}


为何代码一编译不通过,而代码二编译顺利通过?
求解

------解决方案--------------------
max 名称和 std::max 重名了, 改个名字或去掉 using namespace std;