Problem while initializing teh character 2D array

My Program -> https://ide.codingblocks.com/s/350972

In the above given program, in the 2D character array the column size is of 4.

But when I initialize column size with 4 then it shows error. So make the code work I have initialized it with 5.

So can you please explain why it is giving me error for column size 4, although my character array is having 4 columns only??

hello @Shivam01

u missed null character if ur lenght of string is 4 then 5th char will always be \0.

always remember if u r declaring char array then ur array size will be 1 greater than the number chaaracter (because of char array)

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.