鱼C论坛

 找回密码
 立即注册
分享 静态循环队列
2013-9-12 23:53
//静态循环队列 #include stdio.h #include malloc.h #define Len 6 //队列长度 typedef struct Queue { int * pBase; int front; int rear; }QUEUE; void init(QUEUE *); //初始化队列 bool ...
个人分类: 数据结构|457 次阅读|0 个评论
分享 动态栈
2013-9-10 10:57
//动态栈 #include stdio.h #include malloc.h #include stdlib.h typedef struct Node { int data; struct Node * pNext; }NODE,*PNODE; typedef struct stack { PNODE pTop; PNODE pBottom; }STACK,* PSTACK; void i ...
个人分类: 数据结构|770 次阅读|0 个评论
分享 LinkList
2013-9-6 15:12
#include stdio.h #include malloc.h #include stdlib.h typedef struct Node { int data; //数据域,可以很复杂 struct Node * pNext; //指针域 }*PN ...
个人分类: 数据结构|372 次阅读|0 个评论
分享 模拟存放int类型数据的动态数组ArrayList
2013-9-4 17:17
//模拟存放int类型数据的动态数组 #include stdio.h #include malloc.h #include stdlib.h struct Arr { int * pBase; //数组首地址 int len; ...
个人分类: 数据结构|464 次阅读|0 个评论
分享 malloc之跨函数使用内存
2013-8-29 16:53
#include stdio.h #include malloc.h struct Student{ int sid; int age; }; struct Student * CreateStudent(); void ShowStudent(struct Student *); int main() { struct Student *ps; ps = CreateStudent(); //&nb ...
个人分类: C\C++|452 次阅读|0 个评论
分享 malloc
2013-8-29 15:41
#include stdio.h #include malloc.h int main() { int len,i; printf("请输入需要分配的数组长度len的值:"); scanf("%d",len); int * pArr = (int *)malloc(sizeof(int) * len); for(i=0; ilen; ++i ...
个人分类: C\C++|383 次阅读|0 个评论
分享 指针
2013-8-29 15:07
#include stdio.h int main() { int* p; int** i; int j = 90; p = j; i = p; printf("*p的值:%d\n",*p); printf("指针p的地址:%p\n",p); ...
个人分类: C\C++|436 次阅读|0 个评论

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-20 06:52

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部