以写方式打开myfile.txt文本文件,正确的选项是()。
A: fopen("myfile.txt","r");
B: fopen("myfile.txt","w");
C: fopen("myfile.txt","rb");
D: fopen("myfile.txt","wb");
A: fopen("myfile.txt","r");
B: fopen("myfile.txt","w");
C: fopen("myfile.txt","rb");
D: fopen("myfile.txt","wb");
举一反三
- 如果要对E盘myfile目录下的文本文件abc.txt进行读操作,文件打开方式应为_______________。 A: open("e:\myfile\abc.txt", "r" ) B: open("e:\myfile\abc.txt", "x" ) C: open( "e:\myfile\abc.txt", "rb" ) D: open("e:\myfile\abc.txt", "r+" )
- 如果要对E盘myfile目录下的文本文件abc.txt进行读操作,文件打开方式应为( )。 A: open("e:\\myfile\\abc.txt", "r+" ) B: open( "e:\\myfile\\abtxt", "rb" ) C: open("e:\\myfile\\abc.txt", "r" ) D: open("e:\\myfile\\abc.txt", "x" )
- 若打开二进制文件,读取数据,正确的fopen函数调用方式是 A: fopen("test.dat","rb") B: fopen("test.dat","wb") C: fopen("test.dat","w") D: fopen("test.dat","a")
- 以二进制只读方式打开一个已有的文本文件file1,正确调用fopen函数的方式是( ) A: fp=fopen("file1","rb"); B: fp=fopen("file1","r+"); C: fp=fopen("file1","rb+"); D: fp=fopen("file1","r");
- 要打开一个已存在的非空文件file.txt用于修改,正确的语句应为( )。 A: fp = fopen("file.txt","w" ); B: fp = fopen("file.txt", "w+" ); C: fp = fopen("file.txt", "r" ); D: fp = fopen("file.txt", "r+" );