若要用只读方式打开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)
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)
举一反三
- 要打开一个已经存在的非空文本文件a.txt用于修改数据,则正确的打开文件语句是( )。 A: fp=fopen("a.txt","r"); B: fp=fopen("a.txt","w"); C: fp=fopen("a.txt","r+"); D: fp=fopen("a.txt","w+");
- 以只读方式打开一个已存在的文本文件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+");
- 以只读方式打开一个已有的文本文件file1.txt,下面有关fopen函数正确的调用方式为________。 A: FILE *fp;fp=fopen("file1.txt","w"); B: FILE *fp;fp=fopen("file1.txt","r"); C: FILE *fp;fp=fopen("file1.txt","r+"); D: FILE *fp;fp=fopen("file1.txt","rb+");
- 以只读方式打开一个已存在的文本文件file1.txt,以下选项中正确的是 。 A: FILE *fp;fp=fopen(“file1.txt”,”r+”); B: FILE *fp;fp=fopen(“file1.txt”,”w”); C: FILE *fp;fp=fopen(“file1.txt”,”r”); D: FILE *fp;fp=fopen(“file1.txt”,”a”);
- 以二进制只读方式打开一个已有的文本文件file1,正确调用fopen函数的方式是() A: FILE*fp;fp=fopen("file1","rb"); B: FILE*fp;fp=fopen("file1","r+"); C: FILE*fp;fp=fopen("file1","r"); D: FILE*fp;fp=fopen("file1","rb+");