C++ – Ambiguous symbol error

c++compiler-errors

int ii, maxnum;  
for(ii=1; ii<=num-1; ii++) {  
    if(count[ii]>max) {  // the part where I get C2872 Ambiguous Symbol error  
        max = count[ii]; // the part where I get C2872 Ambiguous Symbol error  
        maxnum = ii;  
    }  
}  

I've never gotten this error and this is frustrating.

Best Solution

Your variable max conflicts with std::max(). Try using a different name and it ought to fix that error.