问一个简单的函数重载问题

csxxjl 2008-10-17 04:35:09
#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++,请高手们帮我分析一下.

...全文
79 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
csxxjl 2008-10-17
  • 打赏
  • 举报
回复
谢谢.
JJZHK 2008-10-17
  • 打赏
  • 举报
回复
VSTS2008编译没有问题,估计是你的环境问题。

33,319

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧