上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 68 下一页
摘要: 运行结果: 内存使用情况: 写入文件排序好的数据: 创建文件地址以及创建十一级指针 1 char *path = "QQ.txt"; 2 char *sortpath = "QQchiguowei2018.txt"; 3 //创建十一级指针 4 char *********** allP = NUL 阅读全文
posted @ 2018-02-10 23:34 喵小喵~ 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 一.文件载入内存进行多线程检索 获取并定义行数以及定义索引和文本的路径 1 char path[256] = "kaifangX.txt"; 2 char indexpath[256] = "indexkaifangX.txt"; 3 #define N 20151574 索引的结构体 1 //索引 阅读全文
posted @ 2018-02-10 21:52 喵小喵~ 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 获取文件有多少行 1 //获取文件有多少行 2 int getN(char *path) 3 { 4 FILE *pf = fopen(path, "r"); 5 if (pf==NULL) 6 { 7 return -1; 8 } 9 else 10 { 11 int i = 0; 12 whil 阅读全文
posted @ 2018-02-10 19:58 喵小喵~ 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 //多线程多文件,实现线程的调度 9 //释放内存 10 //内存不够的情况,排队完成任务 11 12 //创建多线程结构体 13 stru... 阅读全文
posted @ 2018-02-10 00:11 喵小喵~ 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 char *path = "dangdangwang.txt"; 10 11 #define N 13180820 12 13 //... 阅读全文
posted @ 2018-02-09 23:58 喵小喵~ 阅读(291) 评论(0) 推荐(0) 编辑
摘要: index.h 1 #define _CRT_SECURE_NO_WARNINGS 2 #include<stdio.h> 3 #include<stdlib.h> 4 #define N 10000000 5 6 struct index 7 { 8 int *pindex; 9 int leng 阅读全文
posted @ 2018-02-09 23:42 喵小喵~ 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 创建索引 1 //创建索引 2 struct index 3 { 4 //保存每行偏移的位置 5 int *pindex; 6 //文件的总长度 7 int length; 8 }allindex;//索引 初始化索引数组并把索引写入到文件 1 //初始化索引数组,并把索引写入到文件 2 void 阅读全文
posted @ 2018-02-09 23:24 喵小喵~ 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 创建全局变量 二级指针 指向多个char * 1 //针数组,指向所有的行 2 char **g_pp; 创建一个全局变量,标识一共有多少行,行数要提前获取 1 //文件中含有的行数 2 #define N 28 1 //获取文件的行数 2 int getN() 3 { 4 //打开文件 5 FIL 阅读全文
posted @ 2018-02-09 23:08 喵小喵~ 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 创建结构体存储csdn数据 1 struct csdn 2 { 3 char name[22]; 4 char password[43]; 5 char email[52]; 6 7 }; 对于分配的大小要先获取最大的长度,定义如下 1 //姓名最大长度 2 int namemax = -1; 3 阅读全文
posted @ 2018-02-09 22:24 喵小喵~ 阅读(388) 评论(0) 推荐(0) 编辑
摘要: fwrite 1 //初始化数组 2 int a[100]; 3 for (int i = 0; i < 100;i++) 4 { 5 printf("\n%d", a[i] = i); 6 } 7 8 //以写的方式打开文件 9 FILE *pf = fopen("C:\\1.bin", "wb" 阅读全文
posted @ 2018-02-09 21:53 喵小喵~ 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 68 下一页