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
Post a Comment