malloc函数用法? = =|||
请问一下malloc应该怎么用啊?
还有
*L=(Linklist)malloc(sizeof())
L=(Linklist *)malloc(sizeof())
这两条语句应该怎么理解啊
头晕死了
----------------解决方案--------------------------------------------------------
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
----------------解决方案--------------------------------------------------------
提示: 作者被禁止或删除 内容自动屏蔽