图片文件合成
#include<stdio.h>#include<stdlib.h>
int main()
{
FILE *fp, *fz,*fn;
int a, b,c;
char f_pic, f_file, f_new;
char ch;
printf("请输入图片名:");
scanf_s("%s", f_pic, 30);
printf("请输入文件名:");
scanf_s("%s", f_file, 30);
printf("请输入新生成文件名");
scanf_s("%s", f_new, 30);
if ((a = fopen_s(&fp, f_pic, "rb")) != 0)
{
printf("open the pic eorror a=%d\n",a);
exit(0);
}
else
{
printf("open the FILE ......\n");
}
if ((b = fopen_s(&fz, f_file, "rb")) != 0)
{
printf("open the FILE eorror\n");
exit(0);
}
else
{
printf("open the FILE ......\n");
}
if ((c = fopen_s(&fn, f_new, "wb")) != 0)
{
printf("open the NEW FILE eorror\n");
exit(0);
}
else
{
printf("open the FILE ......\n");
}
while (feof(fp) == 0)
{
ch = fgetc(fp);
fputc(ch, fn);
}
fclose(fp);
while (feof(fz) == 0)
{
ch = fgetc(fz);
fputc(ch, fn);
}
fclose(fz);
fclose(fn);
system("pause");
}
页:
[1]