【Linux C】文本相加

文本相加

实现在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;
  
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值