XP 系统默认情况下是隐藏扩展名的,
搂主输入文件名时把文件的扩展名也加上。
扩展名如: .txt .exe .rmvb .mov
//----------------------------------------------------------------------------//
// 修改了一个错误 //
//------------------//
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int ch;
FILE *in,
*out;
char infile[10],
outfile[10];
printf("Enter the infile name:\n");
scanf("%s",infile);
printf("Enter the outfile name:\n");
scanf("%s",outfile);
printf(infile);
putchar('\n');
printf(outfile);
putchar('\n');
if((in=fopen(infile, "r"))==NULL)
{
printf("cannot open infile\n");
exit(0);
}
if((out=fopen(outfile, "w"))==NULL)
{
printf("cannot open outfile\n");
exit(0);
}
while((ch = fgetc(in)) != EOF)
fputc(ch, out);
fclose(in);
fclose(out);
system("Pause");
return 0;
}
[此贴子已经被作者于2007-11-14 12:05:19编辑过]
—>〉Sun〈<—