Incompatible implicit declaration of built-in function ‘malloc’

前端 未结 5 859
走了就别回头了
走了就别回头了 2020-11-27 03:30

I\'m getting this error:

warning: incompatible implicit declaration of built-in function ‘malloc’

I am trying to do this:

<
5条回答
  •  -上瘾入骨i
    2020-11-27 03:43

    You need to #include . Otherwise it's defined as int malloc() which is incompatible with the built-in type void *malloc(size_t).

提交回复
热议问题