版块
论坛
喜欢
话题
应用
搜索
登录
注册
hhyjmd的个人空间
访问量
1
新鲜事
帖子
资料
http://bbs3.driverdevelop.com/index.php?m=space&uid=84769
一个关于内存的问题
Test 函数的语句GetMemory(str, 200)并没有使str 获得期望的内存,str 依旧是NULL,为什么?void GetMemory(char *p, int num){p = (char *)malloc(sizeof(char) * num);}void T...
全文
回复
(
11
)
2005-07-30 21:22
来自版块 -
c/c++入门(VC,KeilC使用)
◆
◆
表情
告诉我的粉丝
提 交
znsoft
:
你需要判断malloc时能不能正确分配. 而且你的作法是错的.正确的应该这样写 void GetMemory(char **p, int num) { *p = (char *)malloc(sizeof(char) * num); } void Test(void) { c...
(2005-07-31 10:17)
回复
« 上一页
1
2
hhyjmd
加关注
写私信
0
关注
0
粉丝
75
帖子
返回顶部