单选题 设己定义浮点型变量data,以二进制方式把data的值写入输出文件流对象outfile中去,正确的每句是( )。

A、 outfile.write((double*)&data, data);
B、 outfile.write((const char*)&data, sizeof (double));
C、 outfile.write((char*)&data, data);
D、 outfile.write((double*)&data, sizeof (double));
下载APP答题
由4l***4o提供 分享 举报 纠错

相关试题

单选题 在C++中,使用流进行输入输出,其中用于屏幕输入【】。

A、cin
B、cout
C、cerr
D、clog

单选题 读文件最后一个字节(字符)的语句为【】。

A、myfileseekp(ios::end,1);\nc=myfile.get();
B、myfile.seekg(1,ios::end);\nc=myfile.get();
C、myfile.seekp(ios::end,0);\nc=myfile.get();
D、myfile.seekg(-1,ios::end);\nc=myfile.get();

单选题 以下程序执行结果【】。cout.fill('#');cout.width(10);cout<<setiosflags(ios::left)<<123.456;

A、#####123.456
B、123.456
C、123.456####
D、123.456

单选题 执行以下程序:char *str;cin>>str;cout<<str;若输入abcd 1234↙则输出【】。

A、abcd
B、1234
C、输出乱码或出错
D、abcd 1234

单选题 能够设置的格式对齐位不包括【】。

A、ios::center
B、ios::left
C、ios::internal
D、ios::right

单选题 在下列选项中【】不是ostream类的对象。

A、cin
B、cerr
C、clog
D、cout

单选题 下列选项中,用于清除基数格式位置以十六制输出的语句是【】。

A、cout<<setf(ios::dec, ios::basefield);
B、cin>>setf(ios::hex, ios::basefield);
C、cout<<setf(ios::oct, ios::basefield);
D、cout<<setf(ios::hex, ios::basefield);

单选题 读文件最后一个字节(字符)的语句为【】。

A、myfileseekp(ios::end,1);c=myfile.get();
B、myfile.seekg(1,ios::end);c=myfile.get();
C、myfile.seekp(ios::end,0);c=myfile.get();
D、myfile.seekg(-1,ios::end);c=myfile.get();