Strange C++ errors with code that has min()/max() calls

Question :

Strange C++ errors with code that has min()/max() calls,

Answer :

I’m seeing strange errors when my C++ code has min() or max() calls. I’m using Visual C++ compilers.

,

Check if your code is including the windows.h header file and either your code or other third-party headers have their own min()/max() definitions. If yes, then prepend your windows.h inclusion with a definition of NOMINMAX like this:

#define NOMINMAX  #include   

That’s the answer Strange C++ errors with code that has min()/max() calls, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you

Read More  How do you balance fun feature creep with time constraints?