20140923 cin.get() getline cin
生活随笔
收集整理的這篇文章主要介紹了
20140923 cin.get() getline cin
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
#include<iostream>
#include<string>
using namespace std;
int main()
{
??? string title;
??? getline(cin,title);//讀取輸入隊列中的回車,但是丟棄不存儲在title中
??? //cin>>title;//不讀取輸入隊列中的回車,回車仍然在輸入隊列中
??? char a=cin.get();//讀取輸入隊列中多余的回車
}
轉載于:https://www.cnblogs.com/yexuannan/p/4013475.html
總結
以上是生活随笔為你收集整理的20140923 cin.get() getline cin的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用SDWebImage淡入淡出的方式加
- 下一篇: 百度笔试准备2