10 2012 档案

C语言练习
摘要:题目一 将英文文本article-1e.txt~ article-82e.txt共82个文本文件的数据写入一个大文件article.dat,并对article.dat建立索引文件article.idx,在article.idx文件中记录每篇文章在article.dat文件中的起始位置和长度(此为子程序1:建立索引程序); 实现文档检索:通过控制台输入文档编号,程序可通过article.idx查询到该文档在article.dat中的位置,读出该文档并输出到控制台(此为子程序2:检索程序)。参考方法:index.cpp 1 #include <stdio.h> 2 #include & 阅读全文

posted @ 2012-10-29 22:19 whl-hl 阅读(336) 评论(0) 推荐(1)

文件操作学习笔记
摘要:#include <stdlib.h>#include <stdio.h>typedef struct student{ char name[100];int num; int score;}STUDENT;STUDENT stu[ ]={"zhangsan",01,90,"lisi",02,95,"wangwu",03,95};void Wf(){FILE *fp;fp = fopen("stu.txt","wb");int i;for(i=0;i<3;i++){ 阅读全文

posted @ 2012-10-24 09:28 whl-hl 阅读(128) 评论(0) 推荐(0)

导航