随笔分类 -  C

摘要:#include <stdio.h> #define NUMBER 100 int push_queue(int* a, int rear, int data) { a[rear] = data; rear++; return rear; } void pop_queue(int* a, int f 阅读全文
posted @ 2021-03-28 19:34 TO_ZG 阅读(101) 评论(0) 推荐(0)
摘要:#include<stdio.h> struct tree { int data; int l_ch; int r_ch; }; void add_node(struct tree* arr_1,int *arr,int start_index,int index) { arr_1[index].d 阅读全文
posted @ 2021-03-27 12:15 TO_ZG 阅读(160) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdbool.h> #include <stdlib.h> typedef struct node { int data; struct node* next; }Node; typedef struct line_stack { Node 阅读全文
posted @ 2021-03-27 12:07 TO_ZG 阅读(93) 评论(0) 推荐(0)
摘要:#include <stdio.h> #define NUMBER 100 int push(int* a, int top, int data) { a[++top] = data; return top; } int pop(int* a, int top) { if (top == -1) { 阅读全文
posted @ 2021-03-27 11:18 TO_ZG 阅读(130) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; void init_node(struct node **p) { *p = malloc(sizeof(struct node) 阅读全文
posted @ 2021-03-27 10:41 TO_ZG 阅读(132) 评论(0) 推荐(0)
摘要:1.静态变量有名字,可以直接对其操作,而动态变量是一段地址需要通过指针间接地对它进行操作2.静态变量的分配与释放由编译器自动处理,动态变量的分配与释放是由程序员显示的管理,它通过malloc()和free()两个函数完成 阅读全文
posted @ 2018-04-23 18:00 TO_ZG 阅读(159) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <string.h> #include <netinet/in.h> #include <arpa/inet. 阅读全文
posted @ 2018-04-03 17:47 TO_ZG 阅读(314) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <string.h> #include <netinet/in.h> #include <arpa/inet. 阅读全文
posted @ 2018-04-03 17:45 TO_ZG 阅读(161) 评论(0) 推荐(0)
摘要:服务端: #include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/socket.h>#include <string.h>#include <netinet/in.h>#include <arpa/inet.h 阅读全文
posted @ 2018-04-02 17:28 TO_ZG 阅读(176) 评论(0) 推荐(0)