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

IDE:codeblocks

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

解决方法:

引入stdlib.h

#include<stdlib.h>



你可能感兴趣的:(c++ error: 'malloc' was not declared in this scope)