I'm working on a school project and the objective is to take a text file that contains a maze of "#", " ", "E", and "S" characters and find your way through this maze. In the assignment it is asking for me to take the file and put each row and column into a 2D char array.
Here is an example of what the file could look like("S" is where I start and "E" is where I end) :
##########
# S ######
## ####E##
## #### ##
# ##
##########
I thought about using a couple while loops one for finding the height of the maze and adding it to it's "y" component. Then taking each increment of "x" and putting it into the array for it's char value and reading the second y to find both "#" to find the width. However I so far have not implemented it correctly. Do you have any thoughts on how to go about this problem? So far I haven't been able to find it online. Also just to reiterate I need the char value so "#", " ", or "E" and "S" in the proper x and y coordinate in my 2D char array.
I would also provide my code of what I have but that would be considered cheating and as a student I would like to learn the content too. So just thoughts and maybe some examples would be nice.