Syntax error while using a #define in initializing an array, and as arguments to a function in C? [closed]

╄→尐↘猪︶ㄣ 提交于 2019-12-02 06:40:13

The problem is because there is semicolon in your #define TEST 1;.

With this, the program translates to:

int array[] = { 1; }; /*this is illegal!*/

Remedy: remove it so it looks like:

#define TEST 1

which translates to:

int array[] = {1}; /*legal*/

Remove ; after define.

#define TEST 1
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!