- 博客(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
223
原创 对目录文件的操作
01_opendir.c1.opendirDIR *opendir(const char *name);功能: 打开一个目录获得一个目录流指针参数: name:目录名返回值: 成功返回目录流指针 失败返回NULL2.readdirstruct dirent *readdir(DIR *dirp);功能: 从目录流中读取文件信息并将保存信息的结构体 地址返回参数: dirp:目录流指针返回值: 包含文件信息的结构体...
2022-02-21 19:27:11
111
原创 对文件的基本操作
目录01_fopen.c02_fputc.c01_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
434
原创 指针相关应用
快速排序#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
548
原创 递归相关程序
打印闰年#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
445
原创 Linux基本命令(部分)
Linux系统操作全屏模式:ctrl + alt + Enter窗口模式:点击“查看” 点击“立即适应客户机”打开终端: ctrl + alt + t放大字体:ctrl + shift + +缩小字体:ctrl + -
2022-01-06 12:01:37
900
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人