首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

这东西杂整?该怎么处理

2012-04-03 
这东西杂整?Thereisatestfile:c:\example.txt.Pleasewriteaprogramtoprintthecontentofthefiletoscreen.Us

这东西杂整?
There   is   a   test   file:   c:\example.txt.   Please   write   a   program   to   print   the   content   of   the   file   to   screen.   Use   standard   C   language   and   library.

 



[解决办法]
#include <stdio.h>
void main()
{
char ch;
FILE *pf=fopen( "c:/example.txt ", "r ");
ch = fgetc(pf);
while(ch != EOF){
putchar(ch);
ch = fgetc(pf);
}

fclose(pf);
}

热点排行