首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

与 stdlib.h中的realloc冲突?解决办法

2012-03-09 
与 stdlib.h中的realloc冲突?Infileincludedfromex_ftp_basic.h:5,from2collector.c:5:/usr/include/stdli

与 stdlib.h中的realloc冲突?
In   file   included   from   ex_ftp_basic.h:5,
                                  from   2collector.c:5:
/usr/include/stdlib.h:595:   error:   conflicting   types   for   'realloc '
../utils/utils.c:624:   error:   previous   implicit   declaration   of   'realloc '   was   here
/usr/include/stdlib.h:597:   error:   conflicting   types   for   'free '
../utils/utils.c:541:   error:   previous   implicit   declaration   of   'free '   was   here

../utils/utils.c:624行如下:
hunk   =   (char*)realloc   (hunk,   bufsize);

[解决办法]
hunk = (char*)realloc (hunk, bufsize);这样写是对的,但是用realloc 前必须保证hunk非空,是用malloc分配过的,空间不够继续分配。你再试试!
[解决办法]
提示信息仅供参考
[解决办法]
这这.....
很难说...

[解决办法]
贴代码,关键部分就可以了!

热点排行