Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void readMap()
- {
- string name = "firstLoc.txt";
- ifstream firstLoc(name);
- char **map_Matrix = new char*[10];
- for (int i = 0; i < 10; i++)
- {
- map_Matrix[i] = new char[5];
- }
- if (!firstLoc.is_open())
- {
- cout << "File not open. \n";
- }
- else
- {
- while (!EOF)
- {
- for (int i = 0; i < 5; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- firstLoc >> map_Matrix[i][j];
- }
- }
- }
- for (int i = 0; i < 5; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- cout << setw(3) << setprecision(1) << map_Matrix[i][j];
- }
- cout << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement