鱼C论坛

 找回密码
 立即注册
查看: 2519|回复: 0

这源代码有什么问题?

[复制链接]
发表于 2012-8-12 10:05:10 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. #include <stdio.h>
  2. #include <stdlib.h>

  3. void main()
  4. {
  5.         FILE *f_pic, *f_file, *f_finish;
  6.         char pic_name[20], file_name[20], finish_name[20];

  7.         printf("请输入需要合成的图片和文件的名称:\n");
  8.         printf("图片:");
  9.         scanf("%s",pic_name);
  10.         printf("文件:");
  11.         scanf("%s",file_name);
  12.         printf("生成为: ");
  13.         scanf("%s", finish_name);

  14.         if( !(f_pic = fopen(pic_name, "rb")))
  15.         {
  16.                 printf("cannot open the picture %s !", pic_name);
  17.                 return;
  18.         }
  19.         if ( !(f_file = fopen(file_name,"rb")))
  20.         {
  21.                 printf("Cannot open the picture %s !", pic_name);
  22.         }
  23.         if( !(f_finish = fopen(finish_name, "wb")))
  24.         {
  25.                 printf("Cannot open the file %s !", finish_name);
  26.                 return;
  27.         }

  28.         while( !(feof(f_pic)))
  29.         {
  30.                 ch = fgetc(f_pic);
  31.                 fputc(ch, f_finish);
  32.         }
  33.         fclose(f_pic);

  34.         while( !(feof(f_file)))
  35.         {
  36.                 ch = fgetc(f_file);
  37.                 fputc(ch, f_finish);
  38.         }
  39.         fclose(f_file);
  40.         fclose(f_finish);

  41.         system("pause");
  42. }
复制代码


想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-19 07:17

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表