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.
Your variable max
conflicts with std::max()
. Try using a different name and it ought to fix that error.
I think the problem is not std::max()
but these horrible #define's
in minwindef.h
:
#ifndef NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* NOMINMAX */
Use #define NOMINMAX
in your project settings or stdafx.h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With