- 博客(14)
- 收藏
- 关注
原创 3月3日
无名管道代码#include<stdio.h>#include<unistd.h>#include<sys/types.h>#include<stdlib.h>#include<string.h>#include<sys/wait.h>int main(){ int fd[2]; int status; pid_t pid; if(pipe(fd) == -1) { per.
2021-03-04 19:37:52 56 1
原创 3月1日(补)
典型读写应用:#include<stdio.h>#include<stdlib.h>#include<string.h>int main(){ FILE *fp; fp = fopen("./1.txt","w+"); if(fp == NULL) { perror("fopen:"); exit(1); } char *str = "hihi world\n"; int number = fwr.
2021-03-04 19:28:59 42 2
原创 二叉树,2月24日(补)
二叉树的代码实现,及二叉树相关函数的实现#include<stdio.h>#include<stdlib.h>#define N 50#define max 30struct TreeNode{ int value; struct TreeNode *left; struct TreeNode *right;};struct Node{ struct TreeNode *root ; struct Node *next.
2021-03-04 19:24:52 38 1
原创 队列,2月21日(补)
数组队列的实现#include<stdio.h>#define N 20struct queue{ int data[N]; int front; int rear; int size;};void push(struct queue *qp, int dat){ if(qp->size >= N) { printf("queue is full\n"); return; } qp->re.
2021-03-04 19:14:23 42 1
原创 栈,2月19日(补)
链式栈的实现#include<stdio.h>#include<stdlib.h>struct Node{ int value; struct Node *next;};struct stack{ int size; //栈的容量大小 struct Node *bottom; struct Node *top;};struct Node *createNode(int value){ struct N.
2021-03-04 19:09:06 43 1
原创 1月25日
数组:一组数据类型相同的数据 int a【常量】 可以用#define1、数组中所有的数据都是相同的数据类型2、数组中所有元素的首地址都是连续的赋初值的方式:在定义时赋值用循环赋值数组与指针的联系:数组的名字可以作为指针使用a:数组首元素的地址 a = &a[0] a+1= &a[1]&a &a+1 将整个数组看作一个整体+1一对兔子,第一个月不生兔子,第二个月生一对兔子,此后
2021-01-26 20:33:59 81
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人