当前位置: 代码迷 >> C语言 >> 请教高手
  详细解决方案

请教高手

热度:159   发布时间:2005-11-01 23:46:00.0
请教高手

#include<fstream.h>
#include<iostream.h>
#include<stdio.h>
void main(int arvc,char *argv[])
{ int sum,totalsum;
FILE *fp;
char ch;
if((fp=fopen(*++argv,"r"))==NULL)
{
printf("cannot open file\n");
return;
}
while(!feof(fp))
{
ch=fgetc(fp);
printf("\n");
while(ch!='\n'||ch!=EOF)
{
putchar(ch);
if(ch==' ')
{sum++;totalsum++;}
ch=fgetc(fp);
}
printf("\n");
printf("%d",sum);

        }
printf("%d",totalsum);
fclose(fp);
}
请问高手们:这个程序我编译通不过.望指教.请问把它编译成可执行文件后怎么去运行.步骤怎样
搜索更多相关的解决方案: include  return  cannot  

----------------解决方案--------------------------------------------------------
不修改TC(C89标准)是不能编译的,用C99标准的编译器,VC,DEV,C-Free等等
----------------解决方案--------------------------------------------------------
  相关解决方案