全部题库 / C++ / 试题详情
单选题 C++
2013-08-06

设有定义charstr[80];以下不能将输入数据first\nsecond\n<CR>读取到数组str中的语句是(  )。

A.cin.get(str,strlen(str));
B.cin.getline(str,strlen(str));
C.cin>>str;
D.cin.read(str,strlen(str));

参考答案

D

答案解析

D。【解析】本题考查cin流对象的几种成员函数get,getline,read及流提取符>>的使用规则。

你可能感兴趣的试题