   [C++] Input text file into an array
  Hello,I'm trying to convert this external text file...X *   * * * * * * * X * * * * * * * * * * * * * * * * * * * * * * X * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * into an array.This is for a LoadGame function for a battleship game I'm creating for my CS class and I'm stuck at this portion of the project. So far I have this...void LoadGame(string backboard[10][10], string gameboard[10][10]){fstream inputfile;inputfile.open ("Output.txt",ios::in);if (inputfile.fail()){cout << "Cannot open the output file! Terminating ...";exit (1);}else {while (!inputfile.eof()){for (int i=0;i<10;i++){for (int j=0;j<10;j++){inputfile >> gameboard[j];}}}}inputfile.close()}Thanks!
  Sorry, but we can't (as a rule) do your homework for you.If there is a specific technical problem you're having, feel free to post a new thread with details of the exact issue, and provide complete code needed to reproduce the problem. If you can show that you're at least putting forth some effort to solve the problem yourself, then we'll see what we can do [smile]Also, you may find it more appropriate to place your question in the For Beginners forum.   