要从“file.dat”文件中读出第10个字节存到变量C中,下列______方法是合适的。

A:FileInputStream in=new FilelnputStream("file.dat"); in.skip(9); int c=in.read(); B:FileInputStream in=new FilelnputStream("file.dat"); in.skip(10); int c=in.read(); C:FilelnputStream in=new FilelnputSLream("file.dat"); int c=in.read(); D:RandomAccessFile in=new RandomAccessFile("file.dat"); in.skip (9); int c =in.readByte();

要建立文件流并打开当前目录下的文件file. dat用于输入,下列语句中错误的是( )。

A:ifstream fin = ifstream, open( "file. dat" ) ; B:ifstream * fin = new ifstream( "file. dat" ) ; C:ifstream fin; fin. open ( "file. dat" ) ; D:ifstream * fin = new ifstream() ; fin -> open( "file. dat" ) ;

要从“file.dat”文件中读出第10个字节存到变量C中,下列______方法是合适的。

A:FileInputStream in=new FileInputStream("file.dat");in.skip(9);int c=in.read( ); B:FileInputStream in=new FileInputStream("file.dat");in.skip(10);int c=in.read( ); C:FileInputStream in=new FileInputStream("file.dat");int c=in.read( ); D:RandomAccessFile in=new RandomAccessFile("file.dat");in.skip(9);int c=in.readByte( );

下面程序的结果是 ______。
#include<iostream.h>
class A
public:
virtual void fun( )=0;
;
class B:public A
public:
void fun ( ) cout<< "new file" ;
;
class C: public A
public:
void fun ( )cout<<"open file"<< " "
;
class D: public A
public:
void fun ( ) cout<< "save file/n" ;
;
void main( )
A a,*p;
B b;
C c;
D d;
p=&c;
p->fun ( );
p=&b;
p->fun ( );
p=&d;
p->fun( );

A:new file open file save file B:new file new file new file C:编译出错 D:open file new file save file

下面程序的运算结果是( )。
#include<iostream>
using namespace std;
class A

public:
virtual void fun( )=0;
;
class B:public A

public:
void fun( )
cout<<"new file"<<" ";
;
class C:public A

public:
void fun( )
cout<<"open file"<<" ";
;
void main( )

A a, * p;
B b;C c;
p=&c;
p->fun( );
p=&b;

A:new file open file B:new file new file C:编译出错 D:open file new file

假定通用对话框的名称为CommonDialogl,命令按钮的名称为Command1,则单击命令按钮后,能使打开的对话框的标题为“New File”的事件过程是______。

A:Private Sub Command1_Click()
CommonDialogl. DialoqTitle="New File"
CommonDialogl. ShowPrinter
End Sub
B:Private Sub ComJRandl_Click()
CommonDialogl. DialogTitle="New File"
CommonDialogl. ShowFont
End Sub
C:Private Sub Command1_Click()
CommonDialogl. DialogTitle="New File"
CommonDialogl. ShowOpen
End Sub
D:Private Sub Command1_Click()
CommonDialogl. DialogTitle="New File"
CommonDialogl. ShowColor
End Sub

假定通用对话框的名称为CommonDialogl,命令按钮的名称为Command1,则单击命令按钮后,能使打开的对话框的标题为“New File”的事件过程是______。

A:Private Sub Command1_Click() CommonDialog DialoqTitle="New File" CommonDialog ShowPrinter End Sub B:Private Sub ComJRandl_Click() CommonDialog DialogTitle="New File" CommonDialog ShowFont End Sub C:Private Sub Command1_Click() CommonDialog DialogTitle="New File" CommonDialog ShowOpen End Sub D:Private Sub Command1_Click() CommonDialog DialogTitle="New File" CommonDialog ShowColor End Sub

下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun( )=0{}; }; class B:public A{ public: void fun ( ) {cout<< "new file" ;} }; class C: public A{ public: void fun ( ){cout<<"open file"<< " " } }; class D: public A{ public: void fun ( ) {cout<< "save file/n" ;} }; void main( ) { A a,*p; B b; C c; D d; p=&c; p->fun ( ); p=&b; p->fun ( ); p=&d; p->fun( ); }

A:new file open file save file B:new file new file new file C:编译出错 D:open file new file save file

下面程序的运算结果是( )。 #include<iostream> using namespace std; class A { public: virtual void fun( )=0; }; class B:public A } public: void fun( ) {cout<<"new file"<<" ";} }; class C:public A { public: void fun( ) { cout<<"open file"<<" ";} }; void main( ) { A a, * p; B b;C c; p=&c; p->fun( ); p=&b; }

A:new file open file B:new file new file C:编译出错 D:open file new file

微信扫码获取答案解析
下载APP查看答案解析