若打开二进制文件,读取数据,正确的fopen函数调用方式是
A: fopen("test.dat","rb")
B: fopen("test.dat","wb")
C: fopen("test.dat","w")
D: fopen("test.dat","a")
A: fopen("test.dat","rb")
B: fopen("test.dat","wb")
C: fopen("test.dat","w")
D: fopen("test.dat","a")
举一反三
- 定义fp为文件型指针变量,以读写方式打开一个已存在的文本文件test.dat,下面fopen函数正确的调用方式是: A: FILE *fp; fp=fopen("test.dat", "rb"); B: FILE*fp; fp=fopen("test.dat", "r+"); C: FILE *fp; fp=fopen("test.dat", "r"); D: FILE *fp; fp=fopen("test.dat", "rb+");
- 以写方式打开myfile.txt文本文件,正确的选项是()。 A: fopen("myfile.txt","r"); B: fopen("myfile.txt","w"); C: fopen("myfile.txt","rb"); D: fopen("myfile.txt","wb");
- 以二进制只读方式打开一个已有的文本文件file1,正确调用fopen函数的方式是( ) A: fp=fopen("file1","rb"); B: fp=fopen("file1","r+"); C: fp=fopen("file1","rb+"); D: fp=fopen("file1","r");
- 要打开一个已存在的非空二进制文件“file”用于修改,选择正确的语句是( ) A: fp=fopen("file","rb"); B: fp=fopen("file","ab+"); C: fp=fopen("file","wb"); D: fp=fopen("file","rb+");
- 定义fp为文件型指针变量,使用fopen只读方式打开一个已存在的二进制文件,以下正确的调用形式为: A: fp=fopen("my.dat", "r"); B: fp=fopen("my.dat", "rb+"); C: fp=fopen("my.dat", "rb"); D: fp=fopen("my.dat", "r+");