
c语言
文章平均质量分 71
flying_fish_233
真诚做人,认真做事
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
malloc()函数详解
转自:http://blog.csdn.net/xw13106209/article/details/4962479一、原型:extern void *malloc(unsigned int num_bytes);头文件:#include #include<stdio.h> #include<malloc.h> int main() { char *p; p=(char *)mallo转载 2016-02-13 16:07:21 · 550 阅读 · 0 评论 -
free()函数
c语言中经常需要给指针变量分配内存空间,需要用到一组函数:malloc()和free()使用的时候需要包含头文件stdlib.hmalloc()比较好理解,主要关注下free()函数,看下面一段代码:char str = (char ) malloc (100);strcpy(str, “hello world!”);free(str);strcpy(str, “is it OK?”);printf转载 2016-02-13 16:22:59 · 3223 阅读 · 0 评论