- 博客(6)
- 收藏
- 关注
原创 利用函数 分配空间,返回指针
#include#include#includechar *GetMemory(int size)//函数指针 *不能少{char *a=NULL;a=(char *)malloc(sizeof(100));return a;}void get(char **str,int size){*str=(char *)malloc(sizeof(100));
2016-10-27 16:48:02 182
转载 倒序输出
#include#include#includeint main(){char* src = "hello,world";//栈空间 stackint len = strlen(src);char* dest = (char*)malloc(len+1);//要为\0分配一个空间heap 堆空间 手动分配char* d = dest;char* s =
2016-10-27 10:37:22 371
原创 菱形(C语言)
# includeint main(){int i;int j;int c;int m=25;int l=m/2;for(i=0;i{if(i{for(j=0;j{if(j==(l-i) || j==(l+i)){printf(" *");}else{printf(" ");}}printf("\n");
2016-10-19 19:16:57 272
原创 读写文件
#include#include#includetypedef struct stu//结构体{char num[20];char name[20];struct stu * next;}pstu,*st;void write(pstu *head)//写入文件,写入文件不用返回值,只是让这个函数执行写入文件的过程,需要吧链表传进去{if(head==N
2016-10-18 12:38:21 211
原创 链表保存数据
#include#include#includetypedef struct stu//结构体{int num;char name[20];struct stu * next;}pstu,*st;st add(st temp,st *head);//链表 添加节点void show(pstu * head);//显示链表void sss();st
2016-10-18 11:20:36 1210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人