文件 scores.dat 大小是100字节,用文件流 fstream 对象 fst 打开 那么想要读最后一个字节,下面正确的是
A.fst.seekg(100L);
B.fst.seekp(100L);
C.fst.seekg(-1L, std::ios::end);
D.fst.seekg(50L, std::ios::cur);
A.fst.seekg(100L);
B.fst.seekp(100L);
C.fst.seekg(-1L, std::ios::end);
D.fst.seekg(50L, std::ios::cur);
When a couple falls into a divorce or separation, their child often has to make a big____in his or her life.
|
A、exists(p);
B、p.exists();
C、p.empty();
D、empty(p);
A、__1010.0 10_10.001
B、__1010.001 10010.001
C、10__10.001 01010.001
D、1010.001__ 01010.001
A、std::filesystem::path p{R"(C:\temp\hello\world)"}; std::filesystem::space(p).capacity;
B、std::filesystem::space("C:\").capacity;
C、std::filesystem::path p{"C:/"}; std::filesystem::space(p).available;
D、std::filesystem::path p{"C:/"}; std::filesystem::capacity(p).size();
A、文件的读写操作是从文件位置指示器所指向的位置开始
B、文件的读写操作都是从文件头开始的
C、从文件中读写数据之后,文件位置指示器可能会向前移动或者向后移动
D、读文件操作到文件末尾时,再继续读文件内容,文件位置指示器也会发生改变
A、cin 与 cout 都是类
B、cin 是一个 istream 类的对象
C、cout 是一个 ostream 类的对象
D、cin 和 cout 都是 ios 类的对象
对于代码片段: #include <fstream> #include <iostream> using namespace std; int main(){ fstream binaryio; // Create stream object // Read array from the file binaryio.open("array.dat", ios::in | ios::binary); char result[10] = {'\0'}; binaryio.read(reinterpret_cast <char *> (result), 20); cout << result; return 0; } 其中array.dat文件中存放的内容以字节序列表示,各字节的值为 0x30, 0x31, ..., 0x60 执行之后可能出现的状况有:
A、屏幕上没有输出,程序结束,未报告错误
B、屏幕上输出了10个以上字符,程序结束,未报告错误
C、屏幕上输出了10个以上字符,程序出错
D、屏幕上输出了9个字符,然后程序报错
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!