问一个简单的函数重载问题
#include "stdafx.h"
#include <stdlib.h>
#include <iostream.h>
//四个数取最大值的max函数
int max(int i,int j,int m,int n)
{
i=(i>j)?i:j;
i=(i>m)?i:m;
i=(i>n)?i:n;
return i;
}
//三个数取最大值的max函数
int max(int i,int j,int m)
{
i=(i>j)?i:j;
i=(i>m)?i:m;
return i;
}
int main(int argc, char* argv[])
{
int max(int,int,int,int);
int max(int,int,int);
cout<<max(3,5,7)<<endl;
system("pause");
return 0;
}
编译后出错:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
1 error(s), 0 warning(s)
我刚学c++,请高手们帮我分析一下.