while(!feof(infile))
{
fread(inbuffer,80,1,infile);/*read in a line from input file*/
if(!strncmpi(inbuffer,"REM",3)) /*check if it is
a comment line*/
continue; /*it's a comment,so jump back to the while()*/
else
parse_line(); /*not a comment—parse this line*/
}
上例读入一个文件并对其进行分析。“REM(remark的缩写)”用来标识正在被处理的文件中的一个注释行。因为注释行对程序不起任何作用,所以可以跳过它。在读入输入文件的每一行时,上例就把该行的前三个字母与"REM"进行比较。如果匹配,则该行就是注释行,于是就用continue语句返回到while语句,继续读入输入文件的下一行;否则,该行就是一条有效语句,于是就调用parse_line()函数对其进行分析。
break语句用来退出循环。 下面是一个使用break语句的例子:
while (! feof(infile))
fread(inbuffer,80,1,infile) ;/* read in a line from input file * /
if (! strncmpi (inbuffer,"REM",3)) / * check if it is
a comment line * /
continue; /* it's a comment, so jump back to the while() * /
else
{
if (parse_line()==FATAL_ERROR) / * attempt to parse
this line * /
break; /* fatal error occurred,so exit the loop * /
}
http://v.17173.com/playlist_16243005.html
http://v.17173.com/playlist_16244048.html
http://v.17173.com/playlist_16244589.html
http://v.17173.com/playlist_16245740.html
http://v.17173.com/playlist_16246511.html
http://v.17173.com/playlist_16276445.html
http://v.17173.com/playlist_16275379.html
http://v.17173.com/playlist_16274196.html
http://v.17173.com/playlist_16272743.html
http://v.17173.com/playlist_16271745.html
http://v.17173.com/playlist_16270694.html
http://v.17173.com/playlist_16269747.html
http://v.17173.com/playlist_16268962.html
http://v.17173.com/playlist_16267988.html
http://v.17173.com/playlist_16266881.html
http://v.17173.com/playlist_16265728.html
http://v.17173.com/playlist_16264745.html
http://v.17173.com/playlist_16263755.html
http://v.17173.com/playlist_16262692.html
http://v.17173.com/playlist_16260273.html
http://v.17173.com/playlist_16250327.html
http://v.17173.com/playlist_16249446.html
http://v.17173.com/playlist_16248725.html
http://v.17173.com/playlist_16248141.html
http://v.17173.com/playlist_16247142.html
http://v.17173.com/playlist_16301211.html
http://v.17173.com/playlist_16299899.html
http://v.17173.com/playlist_16298388.html
http://v.17173.com/playlist_16297123.html
http://v.17173.com/playlist_16296085.html
http://v.17173.com/playlist_16294578.html
http://v.17173.com/playlist_16293492.html
http://v.17173.com/playlist_16292032.html
http://v.17173.com/playlist_16290619.html
http://v.17173.com/playlist_16289611.html
http://v.17173.com/playlist_16288604.html
http://v.17173.com/playlist_16286938.html
http://v.17173.com/playlist_16285846.html
http://v.17173.com/playlist_16284744.html
http://v.17173.com/playlist_16283600.html
http://v.17173.com/playlist_16282325.html
http://v.17173.com/playlist_16281018.html
http://v.17173.com/playlist_16279921.html
http://v.17173.com/playlist_16279035.html
http://v.17173.com/playlist_16277617.html
http://v.17173.com/playlist_16324284.html
http://v.17173.com/playlist_16323278.html
http://v.17173.com/playlist_16322226.html
http://v.17173.com/playlist_16321011.html
http://v.17173.com/playlist_16320132.html
http://v.17173.com/playlist_16319146.html
http://v.17173.com/playlist_16318138.html
http://v.17173.com/playlist_16317154.html
http://v.17173.com/playlist_16316170.html
http://v.17173.com/playlist_16315099.html
http://v.17173.com/playlist_16313923.html
http://v.17173.com/playlist_16313062.html
http://v.17173.com/playlist_16311883.html
http://v.17173.com/playlist_16310039.html
http://v.17173.com/playlist_16308938.html
http://v.17173.com/playlist_16307556.html
http://v.17173.com/playlist_16306309.html
http://v.17173.com/playlist_16305034.html
http://v.17173.com/playlist_16303450.html
http://v.17173.com/playlist_16302296.html