上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 68 下一页
摘要: IO 创建文件并写文件 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include<io.h> 5 #include<fcntl.h>//文件打开 6 #include<sys/sta 阅读全文
posted @ 2018-02-19 20:48 喵小喵~ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: "%[0-9A-Za-z] 读取一个集合,遇到不是数组或者大小写字母跳出 %*[^0-9A-Za-z]读取所有的非数字字母的字符,忽略 示例: 1 char strall [300]= "123sadsadasdas# 45613213213#yincheng01@163.com\n"; 2 cha 阅读全文
posted @ 2018-02-19 19:41 喵小喵~ 阅读(121) 评论(0) 推荐(0) 编辑
摘要: fseek 1 //文件路径 2 char path[150] = "1.txt"; 3 4 5 //FILE *pf = fopen(path, "a+");//尾部添加,文件指针在尾部 6 //FILE *pf = fopen(path, "w+");//文件指针在头部,清空内容 7 FILE 阅读全文
posted @ 2018-02-19 18:37 喵小喵~ 阅读(291) 评论(0) 推荐(0) 编辑
摘要: list.h 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 //创建密码结点 7 typedef struct passinfo 8 { 9 阅读全文
posted @ 2018-02-19 18:09 喵小喵~ 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 数据挖掘 1 sscanf(str, "%d %s %s %d %d %s %s %s", &ph[i].id, ph[i].name, ph[i].sex, &ph[i].age, &ph[i].tall, ph[i].study, ph[i].mary, ph[i].where); 完整代码 阅读全文
posted @ 2018-02-19 15:15 喵小喵~ 阅读(161) 评论(0) 推荐(0) 编辑
摘要: ferror检测文件异常 perror提示文件错误信息 clearerr清除异常,让文件指针回到开头 完整代码 阅读全文
posted @ 2018-02-19 15:04 喵小喵~ 阅读(161) 评论(0) 推荐(0) 编辑
摘要: fprintf 1 //从读文件中提取字符串到info1.user和info1.password中 2 fscanf(pfr, "%s%s", info1.user, info1.password); fscanf 1 //格式化写入到文件中 2 fprintf(pfw, "%d %s %s\n", 阅读全文
posted @ 2018-02-19 14:42 喵小喵~ 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 //两个步骤,第一步读取文件,并且初始化索引结构体,把初始化的索引结构体写入到文件,第二步,读取这个文件到索引结构体 2 //并对这个结构体进行快速排序,得到顺序的索引,再写入文件 3 #define _CRT_SECURE_NO_WARNINGS 4 #include 5 #include 6 7 char path[256] = "QQ.txt"; 8 ... 阅读全文
posted @ 2018-02-13 00:00 喵小喵~ 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 问题引出: //有限的额内存情况怎么干活//索引载入内存,多线程//索引映射为内存 一.载入内存,按行读取进行多线程 定义路径以及其他信息 1 char path[256] = "kaifangX.txt"; 2 char indexpath[256] = "indexkf.txt"; 3 #def 阅读全文
posted @ 2018-02-11 23:21 喵小喵~ 阅读(915) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 5 char path[256] = "kaifang.txt"; 6 7 void main() 8 { 9 //路径,读写, 10 HANDLE hfile = CreateFileA(path, GENERIC_READ |... 阅读全文
posted @ 2018-02-11 22:48 喵小喵~ 阅读(199) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 68 下一页