今天写了一个很平常的结构体,调用一下居然报错了
#include<bits/stdc++.h>
using namespace std;
struct count
{
int a,b,c;
};
int main()
{
count n={0,0,0};
cout<<n.a;
return 0;
}
报错信息:
[Error] reference to 'count' is ambiguous
原因:
“count”与 系统函数algorithm->count重名
改正后的程序:
#include<bits/stdc++.h>
using namespace std;
struct Count
{
int a,b,c;
};
int main()
{
Count n={0,0,0};
cout<<n.a;
return 0;
}
把"count"改成Count即可