第二章测试
1.

大多数C++程序通常包含(   )头文件,它包含了所有输入/输出操作所需要的信息。


A:iostream.h B:istream.h C:string.h D:ostream.h
答案:A
2.

运算符<<左边的操作数是(    )类的一个对象,右边可以是C++的合法表达式。


A:ifstream B:ofstream C:istream D:ostream 3.

 (     )表示标准错误输出(非缓冲方式)导出程序错误信息。



A:cin B:clog C:cout D:cerr  4.

 (     )表示标准错误输出(缓冲方式),导出程序错误信息。


A:cin B:cerr C:clog D:cout 5.

命名空间成员的访问格式为(        )


A:命名空间标识符.成员名 B:命名空间标识符::成员名 C:命名空间标识符->成员名 D:命名空间标识符:成员名 6.

 ifstream(     )派生而来,把文件绑定到程序输入。


A:istream B:ofstream C:其它都不是 D:ostream 7.

ofstream(     )派生而来,把文件绑定到程序输出。


A:ofstream B:ostream C:istream D:其它都不是 8.

fstream(      )派生而来,把文件绑定到程序输入/输出。



A: iostream B:istream C:ofstream D: ifstream 9.

 (   )是标准输入流。


A:cout B:clog C:cin D:cerr 10.

下面4个选项中,专门用于读取单个字符的是(    )


A:cin.get() B:cin.read() C:cin.getline() D:cin.put()

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(22) dxwkbang
返回
顶部