- 博客(6)
- 收藏
- 关注
原创 利用函数 分配空间,返回指针
#include #include #include char *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
219
转载 倒序输出
#include #include #include int main() { char* src = "hello,world"; //栈空间 stack int len = strlen(src); char* dest = (char*)malloc(len+1);//要为\0分配一个空间heap 堆空间 手动分配 char* d = dest; char* s =
2016-10-27 10:37:22
419
原创 菱形(C语言)
# include int 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
323
原创 读写文件
#include #include #include typedef 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
247
原创 链表保存数据
#include #include #include typedef 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
1255
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅
1