本文转自:http://blog.sina.com.cn/s/blog_60263c1c0101ck25.html
我的技术博客:www.cnblogs.com/overcode
学习C++的同学可能都会遇到一个getline()函数,譬如在C++premer中,标准string类型第二小节就是“用getline读取整行文本”。书上给的程序如下:
int main()
{
string line:
while(getline(cin,line))
cout<
c++ getline()
最新推荐文章于 2024-05-20 22:11:41 发布