我有这样一个程序
#include<AT89S52.H>
sbit LED=P1^0;
void main()
{ int s;
for(s=0;s<5;s++)
LED=0;
}
编译是没错的。但是我给中间加上定义一个数组后
#include<AT89S52.H>
sbit LED=P1^0;
float K[5][10]={
{0.000,0.039,0.079,0.119,0.158,0.198,0.238,0.277,0.317,0.357},
{0.397,0.437,0.477,0.517,0.557,0.597,0.637,0.677,0.718,0.758},
{0.798,0.838,0.879,0.919,0.960,1.000,1.041,1.081,1.122,1.163},
{1.203,1.244,1.285,1.326,1.366,1.407,1.448,1.489,1.530,1.571},
{1.612,1.653,1.694,1.735,1.776,1.817,1.858,1.899,1.941,1.982}
}
void main()
{ int s;
for(s=0;s<5;s++)
LED=0;
}
然后就提示我FOR这里有语法错误,我就奇怪了啊 数组没用上就不应该是我for语法错误啊 还提示我S重复定义了。加入一个数组怎么会出现这么多错误? |