Getline (cin ,string s) function

getline() function read string and does it contain null character at end

getline() function reads whole line of text that ends with new line or until the maximum limit is reached.

@Rajaranjan Yes, getline automatically puts the null character at the end of the string.

@Rajaranjan I hope We’ve cleared your doubt. Please mark this doubt as resolved and rate us on the basis of your experience. Rating option is just below where you mark this doubt as resolve. Your feedback is very important. It helps us to improve our platform and hence provide you the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen the doubt.

Resolve button is under Unresolved Section.