执行如下程序段 #include FILE *fp; fp=fopen("file","w" ); 则磁盘上生成的文件的全名是________
举一反三
- 执行如下程序段#include [stdio.h]FILE *fp;fp=fopen("file","w");则磁盘上生成的文件的全名是 A: file B: file.c C: file.dat D: file.txt
- 执行如下程序段FILE *fp;fp=fopen(file,w);则磁盘上生成的文件全名是 A: file B: file.c C: file.dat D: file.txt
- 若要用只读方式打开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)
- 以下程序执行后,文件test.txt的内容是() #include void main() { FILE *fp; fp=fopen(“test.txt”,”w”); fprintf(fp,”%s”,”How ”); fclose(fp); fp=fopen(test.txt“,”a”); fprintf(fp,”%s”,”are you!”); fclose(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+");