Sir I am unable to understand why we have used cin.get() after we take n as input. In the tutorial, sir has said that to consume the Enter after n, we used that.
Can you please elaborate?
Regarding the cin.get() used in the code
Hello @punetha.anmol001
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().
Happy Learning!!
But there cin.getline is taking input of rows. Enter aaya bhi, then again won’t getline take the input? After taking n as input, are we continuing that till the first row or we start again for rows?
Hello @punetha.anmol001 actually that depends on the buffer of your computer. not every machinery required this cin.get().
and cin.getline it is taking row wise :
that means at the first character rest of the string is stored.
Happy Learning!!