#include<stdio.h>
#include<stdlib.h>
int main()
{ FILE *pic,*file,*finish;
char ch,pic_name[20],file_name,finish_name[20];
printf("请输入需要合成的图片和文件的名称:\n");
printf("图片:");
scanf("%s",pic_name);
printf("文件:");
scanf("%s",file_name);
printf("生成为:");
scanf("%s",finish_name);
if(!(pic=fopen(pic_name,"rb")))
{
printf("cannot open the file %s!",pic_name);
}
if(!(file=fopen(file_name,"rb")))
{
printf("cannot open the file %s!",file_name);
}
if(!(finish=fopen(finish_name,"wb")))
{
printf("cannot open the file %s!",finish_name);
}
system("pause");
while(!(feof(pic)))
{
ch=fgetc(pic);
fputc(ch,finish);
}
fclose(pic);
while(!(feof(file)))
{
ch=fgetc(file);
fputc(ch,finish);
}
fclose(file);
fclose(finish);
system("pause");
}
scanf("%s",&pic_name);