若有定义FILE *fp; 以“只读”方式打开文件C:\test\myfile.txt的正确语句是
A: fp = fopen("C:\test\myfile.txt","r");
B: fp = fopen("C:\\test\\myfile.txt","r");
C: fp = fopen("C:\test\myfile.txt",'r');
D: fp = fopen("C:\\test\\myfile.txt",'r');
A: fp = fopen("C:\test\myfile.txt","r");
B: fp = fopen("C:\\test\\myfile.txt","r");
C: fp = fopen("C:\test\myfile.txt",'r');
D: fp = fopen("C:\\test\\myfile.txt",'r');
举一反三
- 要在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=fopen(“D:\\mydir\\myfile.txt”,”r”);
- 要在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");
- 要在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");
- 要在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");
- 以写方式打开myfile.txt文本文件,正确的选项是()。 A: fopen("myfile.txt","r"); B: fopen("myfile.txt","w"); C: fopen("myfile.txt","rb"); D: fopen("myfile.txt","wb");