#include<stdio.h>
int main(void)
{
const int SIZE = 8;
int by_two[SIZE];
这样写编译器就会报错
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'by_two' : unknown sizeror C2057: expected constant expression
说我没有没有定义SIZE常量,但如果改成这样
#include<stdio.h>
#define SIZE 8
int main(void)
{
int by_two[SIZE];
就可以正常运行,这是为什么啊?这两种定义常量的方式有什么区别吗?求大神指教!
另外我用的是vc++6.0 系统是win8.1 64位 谢谢了O(∩_∩)O~