|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
如题,我按照小甲鱼老师在文件那一节课里的程序要求自己编了一个rar和jpg文件的合成程序,但为什么运行时提示停止工作呀,求求大家帮帮吧:cry
下面是我的源码;
#include <stdio.h>
#include <stdlib.h>
void main()
{
FILE *fpic,*ffile,*ffinish;
char ch,picname[20],filename[20],finishname[20];
printf("请输入需要合成的图片和文件的名称\n");
printf("图片名称:\n");
scanf("%s",picname);
printf("文件名称:\n");
scanf("%s",filename);
printf("生成为:\n");
scanf("%s",finishname);
if( !(fpic= fopen(picname,"rb")))
{
printf("cannot open the picture %s\n",picname);
return;
}
if( !(fpic= fopen(filename,"rb")))
{
printf("cannot open the file %s\n",filename);
return;
}
if( !(fpic= fopen(finishname,"wb")))
{
printf("cannot open the file %s\n",finishname);
return;
}
while(!(feof(fpic)))
{
ch=fgetc(fpic);
fputc(ch,ffinish);
}
fclose(fpic);
while(!(feof(ffile)))
{
ch=fgetc(ffile);
fputc(ch,ffinish);
}
fclose(ffile);
fclose(ffinish);
system("pause");
}
|
|