C语言文件练习----将文件AB中合并,排序后将结果合并到文件C借鉴.pdfVIP

  • 15
  • 0
  • 约2.21千字
  • 约 3页
  • 2021-12-10 发布于福建
  • 举报

C语言文件练习----将文件AB中合并,排序后将结果合并到文件C借鉴.pdf

#include stdafx.h #include stdio.h #include malloc.h #include string.h /* 程序实现:将文件 A B 中合并,排序后将结果合并到文件 C 中 实现思路:先求文件长度,然后再讲数据读入到内存中,然后用冒泡算法排序 程序如果有什么错误,还希望大家多多批评 */ static FILE *fp; int GetLength(char *name) { int len; if ((fp=fopen(name,r))==NULL) { printf(cannot open the file\n); return 0; } else { fseek(fp,0,SEEK_END); len = ftell(fp); } return len; } void write(char *name,char *buffer,int size)//

文档评论(0)

1亿VIP精品文档

相关文档