为什么vc++里面min函数用不了?

来源:百度知道 编辑:UC知道 时间:2024/05/07 02:19:01

MFC已经封装了很多API,不用你自己调用。
Win32是winmain

min属于泛型算法,用这个函数需要加上泛型算法的头文件#include <algorithm>才可以

#include <windows.h>
MIN(x, y)是一个宏

C
#include <math.h>
double max(double x, double y);

C++
#include <algorithm>
using namespace std;
template<class Type>
const Type& min(
const Type& _Left,
const Type& _Right
);
泛型算法

min? 最小值?
要先
#include <algorithm>
using namespace std;