How do you read in characters from a string opened file and store them in 2D array? In particular, it should read ROWS lines,
#include <iostream> #include <fstream> #include <iomanip> #include <string> #include <cstdlib> using namespace std; // define variables const int ROWS = 20; const int COLUMNS = 60; const unsigned int EMPTY = 0, ROCKY = 1, ROUGH = 2, WALL = 3, PLAYER_START = 4, PLAYER_GOAL = 5, MONSTER_GOAL = 6, ATTACKER_START = 7, DRONE_START = 8; typedef unsigned int Level[ROWS][COLUMNS];// creating a new type void loadlevel(Level level[][COLUMNS], string filename);// function prototype int main() { Level nums1[ROWS][COLUMNS];// declaring array string filename1;// declaring string cout << "Please input a filename: "; cin >> filename1;// input filename loadlevel(nums1, filename1);// recall return 0; } void loadlevel(Level level[][COLUMNS], string filename) { ifstream inputdata; inputdata.open(filename.c_str()); for (int i = 0; i < ROWS; i++) { for (int j = 0; j < COLUMNS; j++) { // read the file opened and store the characters in the 2D array } } }