鱼C论坛

 找回密码
 立即注册
查看: 2871|回复: 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 时出错.
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

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

使用道具 举报

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


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

int main()
{
      FILE *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(!fopen(pic_name,"rb"))
      {
            printf("Cannot open the picture %s !\n",pic_name);

            return -1;
      }
      f_pic=fopen(pic_name,"rb");

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

            return -1;
      }
      f_file=fopen(file_name,"rb");


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

            return -1;
      }
     f_finish=fopen(finish_name,"wb");
       


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

           fputc(ch,f_finish);
     }

     fclose(f_pic);

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

           fputc(ch,f_finish);
     }

     fclose(f_file);

     fclose(f_finish);
     return 0;
} 


想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 18:29

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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