一个小错误!
编程环境为: vs2003
当源代码为:
#include "iostream"
int sum(int a[],int n);
using namespace std;
int main()
{
int a[10]={0,1,2,3,4,5,6,7,8,9};
int result=0;
cout<<result;
cin.get();
return 0;
}
int sum(int a[],int n )
{
if (n>0) return a[n]+sum(&a[0],n-1);
else return 0;
}
编译不成功, 出现的提示为: fatal error C1001: c:\program files\microsoft visual studio .net 2003\vc7\include\xlocale(116): fatal error C1001: 内部编译器错误 (编译器文件“f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c”,第 148 行)
当把源代码修改为:
//#include "iostream"
//int sum(int a[],int n);
//using namespace std;
int main()
{
int a[10]={0,1,2,3,4,5,6,7,8,9};
int result=0;
//cout<<result;
//cin.get();
return 0;
}
//int sum(int a[],int n )
//{
// if (n>0) return a[n]+sum(&a[0],n-1);
// else return 0;
//}
就能够通过编译,是否是我的代码有问题呢?