1. 内存管理**malloc和free** void *zmalloc(size_t size); // 对malloc的封装 void *zcalloc(size_t size); // 对calloc的封装 void *zrealloc(void *ptr, size_t size); // ...
分类:
其他好文 时间:
2021-06-10 18:00:14
阅读次数:
0
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 2 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char name[20] ...
分类:
其他好文 时间:
2021-06-10 17:57:57
阅读次数:
0
做《TLPI》第四章的最后习题的时候,体会到内容。 常规的I/O操作有open(),read(),write(),close()还有比较特殊的lseek(),ioctl()。 linux在读写一个文件的时候都会通过一个 “文件偏移量”来确定在哪个位置读写,英文是offset, 而lseek()则可以 ...
分类:
其他好文 时间:
2021-06-10 17:57:11
阅读次数:
0
1 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 4 // 运行程序 ...
分类:
其他好文 时间:
2021-06-08 23:46:49
阅读次数:
0
实验任务一: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char n ...
分类:
其他好文 时间:
2021-06-08 23:29:04
阅读次数:
0
CMakeLists.txt # cmake needs this line cmake_minimum_required(VERSION 3.1) # Define project name project(Pangolin_project) #添加Pangolin画图依赖库 find_packa ...
分类:
其他好文 时间:
2021-06-06 19:47:00
阅读次数:
0
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 2 typedef struct student { int id; /* 学生学号 */ char name[20]; /* 学生姓名 */ char subject ...
分类:
其他好文 时间:
2021-06-06 19:16:23
阅读次数:
0
c语言中用结构体表示点的坐标,并计算两点之间的距离 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; }Point; double dist(P ...
分类:
编程语言 时间:
2021-06-06 18:46:18
阅读次数:
0
写代码的时候遇到这个错误,看了好久才发现问题原因,特此记录一下: data需要写return{ },不写的话就会出现这个错误。 ...
分类:
其他好文 时间:
2021-06-05 18:25:58
阅读次数:
0
1.学生信息处理 代码如下: (全部手敲了一遍累到自己了,就没有加很多注释.....) 1 #include <stdio.h> 2 #include <string.h> 3 #define N 3 4 typedef struct student{ 5 int num; //学号 6 char ...
分类:
其他好文 时间:
2021-06-05 17:45:16
阅读次数:
0