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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -