#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"resource.h"
void main()
{
FILE *IN, *OUT;
char from[100], to[100];
char b[3];
int i=0,j=0;
printf("请输入要转换的文件名称:");
gets(from);
printf("\n");
printf("请输入目标文件名:");
gets(to);
printf("\n");
if((IN=fopen(from, "r"))==NULL)
{
printf("不能打开源文件!\n");
exit(0);
}
if((OUT=fopen(to, "w"))==NULL)
{
printf("不能打开目标文件!");
exit(0);
}
while(!feof(IN))
{
fgets(b,3,IN);
fputs(b, OUT);
}
}
#include<stdlib.h>
#include<string.h>
#include"resource.h"
void main()
{
FILE *IN, *OUT;
char from[100], to[100];
char b[3];
int i=0,j=0;
printf("请输入要转换的文件名称:");
gets(from);
printf("\n");
printf("请输入目标文件名:");
gets(to);
printf("\n");
if((IN=fopen(from, "r"))==NULL)
{
printf("不能打开源文件!\n");
exit(0);
}
if((OUT=fopen(to, "w"))==NULL)
{
printf("不能打开目标文件!");
exit(0);
}
while(!feof(IN))
{
fgets(b,3,IN);
fputs(b, OUT);
}
}