摘要: 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 喵小喵~ 阅读(188) 评论(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 喵小喵~ 阅读(201) 评论(0) 推荐(0) 编辑