MPLAB中先定义了一个数组为256个字节,const unsigned char Buffer[256];
然后在主程序里给数组Buffer[256]赋值,
for(i=0;i<sizeof(Buffer);i++) Buffer[i]=i;编译通不过,出现如下错误:
Error[000] F:\piccode\MSSP\SPI\25AA1024\25AA1024.C 162 : Can't generate code for this expressionHalting build on first failure as requested.
把这句话//for(i=0;i<sizeof(Buffer);i++) Buffer[i]=i;去掉,程序就没问题,编译通过了,这是为什么? |