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 -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -