'main': auto segment too large
来源:百度知道 编辑:UC知道 时间:2024/05/30 16:21:09
就是这个程序:
#include "stdio.h"
#define M 200
#define N ((M+1)+2)
main()
{
int i,j,a[N];
a[0]=2;
for(i=1;i<N;i++)
a[i]=2*i+1;
for(i=1;i<(N-1);i++)
if(a[i]!=0)
for(j=i+1;j<N;j++)
if((a[j]%a[i]==0))
a[j]=0;
printf("\n The primer are [2-%d]:\n",M);
for(i=0,j=0;i<N;i++)
{
if(a[i]!=0)
{
printf("%5d",a[i]);
if((++j)%10==0)
printf("\n");
}
}
return;
}
编译后会报错
'main': auto segment too large,这是MAIN太大了吗?
可是问题出在哪里呢?
#include "stdio.h"
#define M 200
#define N ((M+1)+2)
main()
{
int i,j,a[N];
a[0]=2;
for(i=1;i<N;i++)
a[i]=2*i+1;
for(i=1;i<(N-1);i++)
if(a[i]!=0)
for(j=i+1;j<N;j++)
if((a[j]%a[i]==0))
a[j]=0;
printf("\n The primer are [2-%d]:\n",M);
for(i=0,j=0;i<N;i++)
{
if(a[i]!=0)
{
printf("%5d",a[i]);
if((++j)%10==0)
printf("\n");
}
}
return;
}
编译后会报错
'main': auto segment too large,这是MAIN太大了吗?
可是问题出在哪里呢?
定义的数组过长,有两种方法可以编译通过:
1.在变量定义中的变量名前加xdata修饰。
xdata int a[N];
2.将数据放入程序空间 "code"。
int code a[N];
语句缺少 ';'在 main 函数中
Main executable for Yuri's Revenge需要什么补丁?
The country's main products are gold and cocoa.
“That's the main thing.”什么意思?
A Java编程是出现“Exception in thread 'main' java.lang.NoSuchMethodError:main”可能是哪出问题了?/
错误 tt.c 4: For 语句缺少 ';'在 main 函数中
谁知道c语言中这是什么意思~~~~~'main' : missing storage-class or type specifiers
'parent.main.document' 为空或不是对象 这是什么??
possible use of 'b' before definition in function main
语句缺少';'在 main 函数中 下面程序应该是怎样呢?