再请教一段简单C语言代码

来源:百度知道 编辑:UC知道 时间:2024/05/24 19:04:12
我想把a.txt文件里面的文字调转,输出文件b.txt,应该如何编写

a.txt 里面的内容是第一行是“abcde”,第二行是“12345”,第三行是“ABCDE”
b.txt 里面的内容是第一行是“edcba”,第二行是“54321”,第三行是“EDCBA”

就是每行倒序调换,而不是全部文字调换

请详细编写,要能运行的全部代码

急用
谢谢

!子程序已补全。
这么长的代码,难怪没人帮你。不要把这里当成无偿索取的地方。
花了一个多小时,实在没心情调试了,自己调试吧。
要求C99。

// tline.c -- by Richard Grenville
// Shall use with complier supporting C99 to be safe
// Not Tested
#include <stdio.h>
#include <stdlib.h>

#define HOUZHUI ".tmp"
#define LINESIZE 256

bool chkoverwrite(char *fname);
bool filecpy(FILE *source, FILE *destination);
inline void erroroverflow(void){
printf(ERRMSG[8]);
exit(6);
}

int main(int argc, char *argv[]){
const *ERRMSG[] = {
"Author: Richard Grenville\nUsage: %s Source File [Destination]\n",
"Can't find enough argument\n",
"%s failed, check the order of arguments and filename.\n",
"Read",
"Write"
"Close file failed, check your disk.\n"
"%s already exists. Are you sure you want to overwrite it?(Y/N) ",