有如下的程序: #include <iostream> #include <fstream> using namespace std; int main() { ofstream outf("D:\\temp.t

admin2010-03-29  14

问题 有如下的程序:
   #include <iostream>
   #include <fstream>
   using namespace std;
   int main()
   {
       ofstream outf("D:\\temp.txt",ios_base::trunc) ;
       outf<<"World Wide Web";
       outf.close();
       ifstream inf("D:\\temp.txt");
       char s[20];
       inf>>s;
       inf.close();
       cout<<s;
       return 0;
   }
   执行后的输出结果是【  】。

选项

答案World

解析 提取运算符>>在读取数据时遇到空格、Tab符号以及回车符时将结束此次相关操作。
转载请注明原文地址:https://jikaoti.com/ti/KmW0FFFM
0

最新回复(0)