I am in the process of making a puzzle that inputs to the program comes from a file. The file contains the matrix size and word puzzle contents. The program should produce the sample output shown with one character of the border showing in the output and blank spaces between the characters.
The input from file would look like:
5 8
hptnrocr
aeehkcra
moaiauag
itmupcni
rauioibn
The max size of my array rows and columns can will be 22 and if they exceed 22 or are less than 1 than it will display an error message. Right now when I run my program nothing happens. Any ideas and help will be appreciated.. here is what I have..
puzzle[MAXSIZE][MAXSIZE] when used outside of the declaration/definition of puzzle is a non-existent element. Don't try to access elements that don't exist.
Perhaps instead of puzzle[MAXSIZE][MAXSIZE] you should use the variables you actually read into: rows and/or cols. Although, presumably you meant to read those in from inFile (from which you attempt to read nothing) and not [/i]cin[/i].