- 博客(9)
- 收藏
- 关注
原创 标准io
fopen: 功能:打开或创建文件 FILE *fopen(const char *pathname,const char *mode); 参数: pathpath–包含路径的文件名 mode --文件操作模式 r:只读方式打开,文件读写光标定位到文件开始 r+:读写方式打开,文件读写光标定位到文件开始 w:只写方式打开,如果文件存在就清零,不存在就创建 w+:读写方式打开,如果文件存在就清零,不存在就创建 a:只写方式打开文件,光标定位在开头,写的时候光标在末尾 返回值:打开成功返回文件指针FILE*,失
2020-08-07 08:59:07
213
原创 标准输入、输出、出错的问题
FILE *stdin----指向的文件是标准输入(键盘) FILE *stdout—指向的文件是标准输出(显示屏) FILE *stderr—指向的文件是标准出错(显示屏)
2020-08-06 15:14:03
262
原创 顺序栈的基础代码
1、创建顺序栈管理结构体 2、初始化一个空的顺序栈 3、判断是否为空是否为满 4、入栈出栈 5、遍历 代码: #include<stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> typedef struct seq_stack { int *ps; int len; int cnt; }S,*STACK; STACK init_stack(int len) { STACK
2020-08-01 09:16:06
638
原创 链式栈基础代码
1、初始化 2、new一个新节点 3、判断是否空栈 4、压栈 5、出栈 代码: #include<stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> typedef struct node { int data; struct node *next; }NODE,*PNODE; typedef struct link_stack { struct node *ptop; s
2020-07-31 20:28:28
343
原创 双向循环链表的基础代码
双向循环链表: 1、设计节点 2、初始化空链表 3、新建一个节点 4、插入节点 5、删除节点 6、移动节点 7、查找节点 8、遍历链表 代码: #include<stdlib.h> #include<stdbool.h> #include<stdio.h> #include<string.h> #include<stdbool.h> typedef struct node { int data; struct node *prev; struct
2020-07-30 09:25:46
391
原创 单向循环链表基础代码
单向循环链表: 1、设计节点 2、初始化空链表 3、新建一个节点 4、插入节点 5、删除节点 6、移动节点 7、查找节点 8、遍历链表 代码: #include<stdlib.h> #include<stdbool.h> #include<stdio.h> #include<string.h> #include<stdbool.h> typedef struct node { int data; struct node *next; }NODE,*
2020-07-30 08:59:28
375
原创 单向链表基础代码
单向链表 1、设计节点 2、初始化空链表 3、新建一个节点 4、插入节点 5、删除节点 6、移动节点 7、查找节点 8、遍历链表 代码: #include<stdlib.h> #include<stdbool.h> #include<stdio.h> #include<string.h> #include<stdbool.h> struct student { char *name; int age; float score; }; typedef
2020-07-30 08:56:23
204
原创 顺序表的初始化,插入,删除,遍历,倒序,排序
#include<stdlib.h> #include<stdbool.h> #include<stdio.h> struct ARRAY { int *parr; int len; int cnt; }; void swap(struct ARRAY *p,int n1,int n2); bool is_empty(struct ARRAY *p); bool is_full(struct ARRAY *p); void init_seq_list(struct ARR
2020-07-29 09:10:15
527
原创 有关结构体传入函数的指针问题
struct ARRAY a; //定义了一个结构体 init_seq_list(&a,10); //把结构体的地址传进函数 void init_seq_list(struct ARRAY *p,int l) //定义一个指向结构体指针 &a 和 *p 是指向同一个结构体,表示同一个数据
2020-07-29 08:44:58
501
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅