读书人

为什么提示“error C2065: #039;malloc#039; :

发布时间: 2012-03-18 13:55:38 作者: rapoo

为什么提示“error C2065: 'malloc' : undeclared identifier”
指示的出错语句是:
s->base=(ElemType *)malloc(StackInitSize*sizeof(ElemType));
错误提示:
--------------------Configuration: chp34 - Win32 Debug--------------------
Compiling...
convert.cpp
d:\数据结构算法\chp34\dy_hanshu.cpp(8) : error C2065: 'malloc' : undeclared identifier
Error executing cl.exe.

convert.obj - 1 error(s), 0 warning(s)
这是为什么呀?


[解决办法]

typedef int ElemType;
放到头文件c1.h里面

读书人网 >软件架构设计

热点推荐