若有定义FILE *fp,则下列哪条语句可以实现将以写的方式打开文件d:\\stu.txt文件( )
A: fopen_s(&fp,“d:\\stu.txt”,"w")
B: fopen_s(&fp,“d:\\stu.txt”,"w");
C: fopen_s(&fp,“d:\\stu.txt”,"r");
D: fopen_s(&fp,“d:\\stu.txt”,"wb");
A: fopen_s(&fp,“d:\\stu.txt”,"w")
B: fopen_s(&fp,“d:\\stu.txt”,"w");
C: fopen_s(&fp,“d:\\stu.txt”,"r");
D: fopen_s(&fp,“d:\\stu.txt”,"wb");
举一反三
- 打开一个已经存在的非空文本文件,若文件名为stu,则正确的打开语句为() A: FILE*fp; B: fp=fopen("stu.txt","r") C: B.FILE*fp; D: fp=fopen(stu.txt,r) E: C.FILE*fp; F: fP=fopen("stu,txt","wb") G: D.FILE*fp; H: fp=fopen("stu.txt",w
- 若要用只读方式打开d:\a.txt文件,则需要执行() A: FILE *fp;fp=fopen(d:\a.txt,r); B: FILE *fp;fp=fopen(d:\\a.txt,r); C: FILE *fp;fp=fopen(d:\a.txt,r+); D: FILE *fp;*fp=fopen(d:\a.txt,w)
- 若有定义FILE*fp,则打开与关闭文件的命令是() A: fopen(fp),fclose(fp) B: fopen(fp,“w”),fclose(fp) C: open(fp),close(fp) D: open(fp,“W”),close(fp)
- 以只读方式打开一个已存在的文本文件ab.txt,以下选项中正确的是______。A. FILE *fp;fp=fopen("ab.txt","a");B. FILE *fp;fp=fopen("ab.txt","w");C. FILE *fp;fp=fopen("ab.txt","r");D. FILE *fp;fp=fopen("ab.txt","rb+"); A: FILE *fp;fp=fopen("ab.txt","a"); B: FILE *fp;fp=fopen("ab.txt","w"); C: FILE *fp;fp=fopen("ab.txt","r"); D: FILE *fp;fp=fopen("ab.txt","rb+");
- 要在D盘MyDir目录下新建一个MyFile.txt文件用于写,正确的语句是( )。 A: FILE *fp=fopen("D:\MyDir\MyFile.txt","w"); B: FILE *fp; fp=fopen("D:\\MyDir\\MyFile.txt","w"); C: FILE *fp; fp=fopen("D:\MyDir\MyFile.txt","r"); D: FILE *fp; fp=fopen("D:\\MyDir\\MyFile.txt","r");