| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 410 人关注过本帖
标题:提示while语句没有申明,怎么办?
只看楼主 加入收藏
hexiaohu
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-9-17
收藏
 问题点数:0 回复次数:0 
提示while语句没有申明,怎么办?

我现在需要一个小程序,完成遇到逗号(,)就换行的操作就行,
提示while语句没有申明!我是新手,现在急需处理数据,没有时间去摸,请高手指点!!!
谢谢
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int convert(char infile[],char outfile[]);
int main( )
{
char infile[20],outfile[20];
printf("please input infile name:\n");
gets(infile);
printf("please output outfile name:\n");
gets(outfile);
convert(infile,outfile);
return 0;
}
int convert(char infile[],char outfile[])
{
char temp[20];
FILE *fin,*fout;
if((fin=fopen(infile,"r"))==NULL)
{
printf("can't open input file\n");
exit(1);
}
if((fout=fopen(outfile,"w"))==NULL)
{
printf("can't open output file\n");
exit(1);
}
while(!feof(fin))
{
fscanf(fin,"%s",temp);
if(strcmp(temp,"HANDVEL")==0)
{ fscanf(fin,"%s",temp);
fscanf(fin,"%s",temp);
fscanf(fin,"%s",temp);
fprintf(fout,"HANDVEL ");
}
else
{ fprintf(fout,"%s ",temp);
fscanf(fin,"%s",temp);
fprintf(fout,"%s\n",temp);
}
}
while (scanf char(20)==",")
printf ("\n"); 遇到逗号就换行的语句
提示while语句没有申明!
fclose(fin);
fclose(fout);

return 0;
}

搜索更多相关主题的帖子: 提示 语句 
2007-09-18 11:41
快速回复:提示while语句没有申明,怎么办?
数据加载中...
 
   



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

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