Message from C, C++ talks

June 2019

— How can I take multiline inputs from stdin i.e console and then print the same number of lines

— There is std::getline

— For starters

— Bro I pmed you


If you use cin» before getline there will be a problem that getline() sees the newline character and stops reading any further.

call cin.ignore() between cin» and getline()

— Thats expected behaviour though lol

— Yup😅

— Capitalization matters

— Write complete line of code of taking multiline input and store it in String 'inp'..

— Plzz

— while(getline(cin,inp) && inp[0]!='\0'){
//your code

— Don't worry 😉

— 😄😄

— Ohkk...Thanks

— Why inp[0] inp[0] has 1st character imput while we have to check for character imputed