How to input multiple line in C++? -


i want take input user multiple lines. when run program , write "hello, name umer" here when enter write new line. program runs. want write new line. code read inpput.

string text;      cout<<"enter text"<<endl;     getline(cin,text); 

how can input muliple line in c++?

you want use loop multiple lines.

while(getline(cin,line)) {   cout << line << endl;   //do } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -