Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why the program is taken with 2 dimensional array??

0 votes
asked Apr 25 by Naga Kiran Gadde (120 points)

1 Answer

0 votes
answered Jul 14 by xDELLx (4,860 points)
char info[15][15]; // 2 dimensional array is used since u need to store multiple strings in a single place.

Single dimension (char) array store a bunch of characters in contiguous memory locations & create a string.

Now since we need to store a bunch of strings (1-dimensinal array) in contiguous memory locations , we need another dimension to the array.

Also since you are already using c++ , I would suggest to use std::strings as its more high-level than raw strings & more work-able in code
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...