Plz explain when we use cin.getline() function and when we use getline(cin,str) function.Also tell the limitation like why we cannot use cin.getline() with strings
Difference btw cin.getline() and getline() finction
Hey Ketan,
- cin.getline(name_of_char_array,size) works with character arrays and has two parameters.
- getline(cin,name_of_string) works with string objects.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us 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.