帮忙看看这段程序有什么错误?#include "stdafx.h"#include#includevoid main(){\x05FILE *fp;\x05char *filename="test";\x05if((fp=fopen(filename,"r"))==NULL)\x05\x05printf("Cannot open the file!\n");\x05\x05else\x05\x05\x05printf("Open file se

来源:学生作业帮助网 编辑:作业帮 时间:2024/06/17 09:03:51
帮忙看看这段程序有什么错误?#include
xSkP~Gt/{=>/YY6nNJ D7a" MM7{ؽuA~sw{|)=}z,<$ $E,@AM܂kBdU8Y5.lL&FQ f*jZdhc*E+KH3`Wn g zYH} "AH?.ψ8bfeAUN$$AØ#;A~M4z2NRVK^MJA`s]-,V0K&UN%tσtp4!i5vy-h ϰ|F_.μ4Gr2ACJ;]I-6z=J58ŵv|~tޤEjxy0ĩ_8ox;}# cyóWߝIK`6L0?'[6 OsNp%nw]%rdJDyYO ].$

帮忙看看这段程序有什么错误?#include "stdafx.h"#include#includevoid main(){\x05FILE *fp;\x05char *filename="test";\x05if((fp=fopen(filename,"r"))==NULL)\x05\x05printf("Cannot open the file!\n");\x05\x05else\x05\x05\x05printf("Open file se
帮忙看看这段程序有什么错误?
#include "stdafx.h"
#include
#include
void main()
{
\x05FILE *fp;
\x05char *filename="test";
\x05if((fp=fopen(filename,"r"))==NULL)
\x05\x05printf("Cannot open the file!\n");
\x05\x05else
\x05\x05\x05printf("Open file seccess!\n");
\x05char ch=fgetc(fp);
\x05while(ch!=EOF)
\x05{
\x05\x05putchar(ch);
\x05\x05ch=fgetc(fp);
\x05}
\x05fclose(fp);
\x05getchar();
}

帮忙看看这段程序有什么错误?#include "stdafx.h"#include#includevoid main(){\x05FILE *fp;\x05char *filename="test";\x05if((fp=fopen(filename,"r"))==NULL)\x05\x05printf("Cannot open the file!\n");\x05\x05else\x05\x05\x05printf("Open file se
filename应该为文件的路径,fopen的第二个参数为r,代表 以只读方式打开文件且该文件必须存在.如下所示,其中c盘必须有test.txt这个文件,否则打开文件失败.还有,只有在打开文件成功的情况下,才有读取文件内容的操作.
void main(){FILE *fp;char *filename="C:/test.txt";if((fp=fopen(filename,"r"))==NULL)printf("Cannot open the file!\n");else{
printf("Open file seccess!\n");char ch=fgetc(fp);while(ch!=EOF){putchar(ch);ch=fgetc(fp);}fclose(fp);
}getchar();}