2D Character Array

In this code if we declare 2D character array like
char arr[5] [1000]
then if take input from 0 to 4 using getline
why does it take only 4 strings
doesn’t take 5th string
does arr[4] contains “\n”???

hello @ishank01

pls save ur code here->https://ide.codingblocks.com/
and share its link with me

in this code if I don’t write cin.get() it takes n-1 lines. In nth line what is stored “\n” or something else…

after reading n(the number of input), \n will remain inside buffer so to remove it we have to use cin.get() o

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.