| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 717 人关注过本帖
标题:malloc函数用法? = =|||
只看楼主 加入收藏
abenmaoiau
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-12-4
收藏
 问题点数:0 回复次数:3 
malloc函数用法? = =|||
请问一下malloc应该怎么用啊?
还有
     *L=(Linklist)malloc(sizeof())
      L=(Linklist *)malloc(sizeof())
这两条语句应该怎么理解啊
    头晕死了
搜索更多相关主题的帖子: malloc 函数 用法 
2007-12-05 13:32
zbqf109
Rank: 1
等 级:新手上路
帖 子:289
专家分:0
注 册:2006-12-31
收藏
得分:0 
malloc
Allocates memory blocks.

void *malloc( size_t size );

Return Value
malloc returns a void pointer to the allocated space, or NULL if there is insufficient memory available. To return a pointer to a type other than void, use a type cast on the return value. The storage space pointed to by the return value is guaranteed to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item. Always check the return from malloc, even if the amount of memory requested is small.

Parameter
size
Bytes to allocate

坚决不跟用TC的人打交道!
2007-12-05 14:22
夜礼服假面
Rank: 1
等 级:禁止访问
帖 子:92
专家分:0
注 册:2007-11-26
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2007-12-05 16:09
kidd2005
Rank: 1
等 级:新手上路
帖 子:193
专家分:0
注 册:2007-11-2
收藏
得分:0 
链表好像也是颇为高深的东西啊~

潜心苦C,却发觉百C不得其解啊~
2007-12-05 16:33
快速回复:malloc函数用法? = =|||
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011703 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved