- 博客(6)
- 收藏
- 关注
原创 文件IO操作
head.h #ifndef _HEAD_H_ #define _HEAD_H_ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #e
2022-02-21 19:40:23
277
原创 对目录文件的操作
01_opendir.c 1.opendir DIR *opendir(const char *name); 功能: 打开一个目录获得一个目录流指针 参数: name:目录名 返回值: 成功返回目录流指针 失败返回NULL 2.readdir struct dirent *readdir(DIR *dirp); 功能: 从目录流中读取文件信息并将保存信息的结构体 地址返回 参数: dirp:目录流指针 返回值: 包含文件信息的结构体 ...
2022-02-21 19:27:11
144
原创 对文件的基本操作
目录 01_fopen.c 02_fputc.c 01_fopen.c #include <stdio.h> int main(int argc, const char *argv[]) { if (argc != 2) { printf("Usrge:./a.out filename\n"); return -1; } FILE *fp = fopen(argv[1],"w"); if (NULL == fp) { printf("fail to fo
2022-02-17 21:15:38
457
原创 指针相关应用
快速排序 #include <stdio.h> void Swap(int *a,int *b) { int t; t = *a; *a = *b; *b = t; } void printArray(int *begin,int *end) { while(begin <= end) { printf("%d\n",*begin); ++begin; } } void qSort(int *begin,int * end) { if(begin >
2022-02-10 19:39:06
572
原创 递归相关程序
打印闰年 #include <stdio.h> int isLeapyear(int year) //打印闰年 { return year % 4 == 0 && year % 100 != 0 || year % 4 ==0; } void printLeapyears(int n) { int i; for(i = 1900;i <= n;++i) { if(isLeapyear(i)) { printf("
2022-01-19 17:38:57
473
原创 Linux基本命令(部分)
Linux系统操作 全屏模式:ctrl + alt + Enter 窗口模式:点击“查看” 点击“立即适应客户机” 打开终端: ctrl + alt + t 放大字体:ctrl + shift + + 缩小字体:ctrl + -
2022-01-06 12:01:37
970
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅