The reason he said for the use of cin.get() after cin>>n; is that it will consume the enter after the statement above it.
Please be more clearer.
Use of cin.get()
@a.amanbhardwaj6 hey, cin.get() is used for accessing character array. It includes white space characters. Generally, cin with an extraction operator (>>) terminates when whitespace is found. However, cin.get() reads a string with the whitespace.To agr whitespace ayega ya enter ayega to programme terminate nhi hoga input leta rhega cin.get().
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.