c++ error: 'malloc' was not declared in this scope

来源:互联网 发布:在数组中添加元素 编辑:程序博客网 时间:2024/05/17 00:52

IDE:codeblocks

c++中使用malloc()时,出现error: 'malloc' was not declared in this scope

解决方法:

引入stdlib.h

#include<stdlib.h>