Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

min()/max() problems

Started by Rebooted Apr 19, 2004 at 10:54 AM 1 replies 750+ views
Original Post
Rebooted
Rebooted
I'm trying to use min() and max(), which I believe are defined in algorithm. Even when including algorithm, both Dev C++ and MSVC doesn't seem to find min() or max().
#include <algorithm>

int main()
{
   int test = min(1, 0);

   return 0;
}
 
Am I missing something? In MSVC I get "error C2065: 'min' : undeclared identifier" [edited by - Shard on April 19, 2004 12:01:00 PM]
Rebooted
Rebooted
Thanks man, that was a stupid mistake. With some compilers min/max are macros, so the std:: is not needed or valid. With others they are inline functions.

[Edited by - Rebooted on October 26, 2004 5:27:51 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.