标题:出错:[Error] expected declaration or statement at end of input
只看楼主
kuaisha
Rank: 2
等 级:论坛游民
帖 子:120
专家分:30
注 册:2016-8-3
结帖率:100%
 问题点数:0 回复次数:2 
出错:[Error] expected declaration or statement at end of input
程序代码:
#include<stdio.h>
#include<stdlib.h>

int main(int argc,char *argv[])
{

 int ch;

 FILE *source,*destination;

 if ( (source = fopen(argv[1],"rb")) == NULL)

 {
  printf ("Can't open %s\n", argv[1]);
  exit(1);

 }

 if ( (destination = fopen(argv[2],"wb")) == NULL)

 {
  printf ("Can't open %s\n", argv[2]);
  exit(1);

 }

 while ((ch = getc(source)) != EOF)
  putc(ch,destination);

 fclose(source);

 fclose(destination);

 printf ("copy finished\n");

 return 0;
搜索更多相关主题的帖子: 出错 expected int source printf 
2018-08-13 22:53
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
得分:0 
排版后,你不觉得最后不对齐,缺少一个 } 吗?
2018-08-14 10:07
kuaisha
Rank: 2
等 级:论坛游民
帖 子:120
专家分:30
注 册:2016-8-3
得分:0 
回复 2楼 rjsp
还真没留意,不过谢谢大佬。

[此贴子已经被作者于2018-8-14 23:07编辑过]

2018-08-14 21:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-489184-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014749 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved