why sir used cin.get();
after input of n.
Doubt in getline vedio?
if u are reading string after integer then use cin.get
it will consume extra \n present inside buffer.
in other cases it is not necessary
but when we use cin>>a;(a is string) here we don’t use cin.get(); after reading the integer.
Please refer to this answer for detailed answer.
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.