求助! ,解决CCS3.3编译出问题

2019-07-25 15:49发布

求助! ,解决CCS3.3编译出问题

ccs3.3环境下使用了malloc函数,编译出错!

#include "stdlib.h"

int *p;
p=(int *)malloc(100 * sizeof(int));
。。。

"main.c", line 45: error: this declaration has no storage class or type specifier
"main.c", line 45: error: declaration is incompatible with "int *pppp" (declared at line 44)
"main.c", line 45: error: function call is not allowed in a constant expression
"main.c", line 45: error: expression must have arithmetic or pointer type



友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。