I have a file Map.txt and there is a 2D array saved inside of that file, but whenever I try to print my 2D array in my main program I get crazy numbers. Code:
cout << "Would you like to load an existing game? Enter Y or N: " << endl;
cin >> Choice;
if (Choice == 'Y' || Choice == 'y')
{
fstream infile;
infile.open("Map.txt");
if (!infile)
cout << "File open failure!" << endl;
infile.close();
}
if (Choice == 'N' || Choice == 'n')
InitMap(Map);
Map saved in file:
********************
********************
********************
********************
********************
********************
********************
**********S*********
*****************T**
********************
Output when program is run:
Would you like to load an existing game? Enter Y or N:
y
88???????`Ė
?(?a????
??_?
?дa??g @
Z???@
?
?a??p`Ė??p]?
??_???`Ė?
??a??#E@??
??_??