鱼C论坛

 找回密码
 立即注册
查看: 3464|回复: 2

求解答 为什么有一个错误??

[复制链接]
发表于 2014-8-4 10:16:34 | 显示全部楼层 |阅读模式

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

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

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

void main()
{
      FLIE *f_pic, *f_file, *f_finish;

      char ch,pic_name[20],file_name[20],finish_name[20];

      printf("请输入需要合成的图片和文件的名称:\n");

      printf("图片:");

      scanf("%s",pic_name);

      printf("文件:");

      scanf("%s",file_name);

      printf("生成为:");

      scanf("%s",finish_name);

      if(!f_pic=fopen(pic_name,"rb"))
      {
            printf("Cannot open the picture %s !",pic_name);

            return;
      }

      if(!f_flie=fopen(file_name,"rb"))
      {
            printf("Cannot open the pile %s!",file_name);

            return;
      }

     if(!f_finish=fopen(finish_name,"wb"))
      {
            printf("Cannot open the pile %s!",finish_name);

            return;
      }

     while(!(feof(f_pic)))
     {
           ch=fgetc(f_pic);

           fputc(ch,f_finish);
     }

     fclose(f_pic);

     while(!(feof(f_flie)))
     {
           ch=fgetc(f_file);

           fputc(ch,f_finish);
     }

     fclose(f_file);

     fclose(f_finish);

     system("pause");
}

错误是:E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2065: 'FLIE' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2065: 'f_pic' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2065: 'f_file' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2100: illegal indirection
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2065: 'f_finish' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(6) : error C2100: illegal indirection
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(8) : error C2143: syntax error : missing ';' before 'type'
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(14) : error C2065: 'pic_name' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(18) : error C2065: 'file_name' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(22) : error C2065: 'finish_name' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(24) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(24) : warning C4024: 'fopen' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(24) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct _iobuf *'
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(24) : error C2106: '=' : left operand must be l-value
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(31) : error C2065: 'f_flie' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(31) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(31) : warning C4024: 'fopen' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(31) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct _iobuf *'
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(31) : error C2106: '=' : left operand must be l-value
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(38) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(38) : warning C4024: 'fopen' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(38) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct _iobuf *'
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(38) : error C2106: '=' : left operand must be l-value
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(45) : error C2223: left of '->_flag' must point to struct/union
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(47) : error C2065: 'ch' : undeclared identifier
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(47) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(47) : warning C4024: 'fgetc' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(49) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(49) : warning C4024: 'fputc' : different types for formal and actual parameter 2
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(52) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(52) : warning C4024: 'fclose' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(54) : error C2223: left of '->_flag' must point to struct/union
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(56) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(56) : warning C4024: 'fgetc' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(58) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(58) : warning C4024: 'fputc' : different types for formal and actual parameter 2
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(61) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(61) : warning C4024: 'fclose' : different types for formal and actual parameter 1
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(63) : warning C4047: 'function' : 'struct _iobuf *' differs in levels of indirection from 'int '
E:\visual c\MSDev98\MyProjects\bbb\bbb.c(63) : warning C4024: 'fclose' : different types for formal and actual parameter 1
执行 cl.exe 时出错.
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-8-4 10:39:34 | 显示全部楼层
{:7_176:}
你违规了  2. 代码大于20行以上时,最好写清自己的思路和注释,这样回答的人才能尽快给大家答案!(避免扔上一大堆代码,说是有错误,请人指点!)
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2014-8-4 10:57:41 | 显示全部楼层
本帖最后由 oggplay 于 2014-8-4 11:15 编辑


你打错了个别单词,我改了一下,能编译通过,不过我没看算法!
  1. #include <stdio.h>
  2. #include <stdlib.h>

  3. int main()
  4. {
  5.       FILE *f_pic, *f_file, *f_finish;

  6.       char ch,pic_name[20],file_name[20],finish_name[20];

  7.       printf("请输入需要合成的图片和文件的名称:\n");

  8.       printf("图片:");

  9.       scanf("%s",pic_name);
  10.       

  11.       printf("文件:");

  12.       scanf("%s",file_name);

  13.       printf("生成为:");

  14.       scanf("%s",finish_name);

  15.       if(!fopen(pic_name,"rb"))
  16.       {
  17.             printf("Cannot open the picture %s !\n",pic_name);

  18.             return -1;
  19.       }
  20.       f_pic=fopen(pic_name,"rb");

  21.       if(!fopen(file_name,"rb"))
  22.       {
  23.         printf("Cannot open the pile %s!\n",file_name);

  24.             return -1;
  25.       }
  26.       f_file=fopen(file_name,"rb");


  27.      if(!fopen(finish_name,"wb"))
  28.       {
  29.             printf("Cannot open the pile %s!\n",finish_name);

  30.             return -1;
  31.       }
  32.      f_finish=fopen(finish_name,"wb");
  33.       


  34.      while(!(feof(f_pic)))
  35.      {
  36.            ch=fgetc(f_pic);

  37.            fputc(ch,f_finish);
  38.      }

  39.      fclose(f_pic);

  40.      while(!feof(f_file))
  41.      {
  42.            ch=fgetc(f_file);

  43.            fputc(ch,f_finish);
  44.      }

  45.      fclose(f_file);

  46.      fclose(f_finish);
  47.      return 0;
  48. }
复制代码



小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-7-4 03:43

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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