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

关于文件读写的有关问题。求。

2012-12-15 
关于文件读写的问题。。。急求。。。void main(){char chif ((source fopen(test1.txt,r)) NULL){prin

关于文件读写的问题。。。急求。。。
void main()
{
char ch;
if ((source = fopen("test1.txt","r")) == NULL)
{
printf("cannot open source file!\n");
exit(0);
}
if ((code = fopen("tokenOut.txt","w")) == NULL)
{
printf("cannot open destination file!\n");
exit(0);
}
while((ch=fgetc(source)) != EOF)
{
getToken();
}
fclose(source);
}
想读取test1.txt的内容,一个一个字符读取,用getToken()函数分析并输出分析结果,为什么没有结果输出?

热点排行