返回信息流c++ primer 第四版说文件结束符是ctrl+z,可是我试过不对,到底文件结束符是什么呢?
#include<string>
#include<list>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
list<string> ilist;
string sval ,searchvalue;
cout<<"enter some strings (ctrl+z to end):"<<endl;
while(cin>>sval)
ilist.push_back(sval);
cout<<"enter the string to search:"<<endl;
cin>>searchvalue;
cout<<cout<<(ilist.begin(),ilist.end(),searchvalue)
<<"elements in the list are\""
<<searchvalue<<"\""<<endl;
return 0;
}
一直退不出输入sval这一步,郁闷啊。
大牛们给支个招。
这是一条镜像帖。来源:北邮人论坛 / cpp / #72201同步于 2013/6/29
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
文件结束符的困惑
shakeup
2013/6/29镜像同步3 回复
订阅后,新回复会通过你的通知中心匿名送达。