We have no given the number of rows and only supplied the number of columns. So when I say words[4] shouldn’t it give me the row 4?(which does not exist here). How is it stored in the memory?
How is the 2-D array working here?
Hi Vipul. It is stored in the memory as char array.
So when you use cout<<words[4], it points to the start of the 5th word(0-indexed) and then it prints that entire 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.