文本相加
实现在text1.txt和text2.txt文件中除去首行和末尾对应的数据,要求三个文本内容如下:
text1 text2 text3
begin begin begin
10 11 12 15 16 17 25 27 29
20 21 22 25 26 27 45 47 49
30 31 32 35 36 37 65 67 69
end end end
#include <stdio.h>
#include <errno.h>
FILE* fopen_text (const char *, const char *);//打开文件
int fputc_text(const int ,FILE*); //写入字符
int main()
{
FILE *fp_text1 = fopen_text ("text1.txt", "r");
FILE *fp_text2 = fopen_text ("text2.txt", "r");
FILE *fp_text3 = fopen_text ("text3.txt", "w+");
char ch1;