当前位置: 代码迷 >> C语言 >> malloc函数用法? = =|||
  详细解决方案

malloc函数用法? = =|||

热度:327   发布时间:2007-12-05 13:32:33.0
malloc函数用法? = =|||
请问一下malloc应该怎么用啊?
还有
     *L=(Linklist)malloc(sizeof())
      L=(Linklist *)malloc(sizeof())
这两条语句应该怎么理解啊
    头晕死了
搜索更多相关的解决方案: malloc  函数  用法  

----------------解决方案--------------------------------------------------------
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
----------------解决方案--------------------------------------------------------
提示: 作者被禁止或删除 内容自动屏蔽
2007-12-05 08:09:27
kidd2005

等 级:新手上路
帖 子:193
专家分:0
注 册:2007-11-2
  得分:0 
链表好像也是颇为高深的东西啊~
----------------解决方案--------------------------------------------------------
  相关解决方案