Question: Language is C++ I have a code written that is meant to read a matrix text file and display it in rows and columns. The

Language is C++

I have a code written that is meant to read a matrix text file and display it in rows and columns. The program will read the first line of the text file which will be the dimensions of the matrix. For example:

Matrix.txt

4 8

23 54 56 6 34 65 76 87

45 78 34 23 5 78 15 43

78 32 54 3 54 15 45 34

7 6 98 34 78 3 78 23

What program should output:

23 54 56 6 34 65 76 87

45 78 34 23 5 78 15 43

78 32 54 3 54 15 45 34

7 6 98 34 78 3 78 23

My Code:

#include #include #include #include using namespace std;

int** theTable;

int main() {

int numRows = 10; int numCols = 20;

int** theTable = new int* [numRows];

string fileName; cout

ifstream fin; fin.open(fileName); if (!fin) { cout

for (int i = 0; i

for (int r = 0; r > theTable[r][c]; cout

fin.close(); }

What my program is outputting;Language is C++ I have a code written that is meant to

Code Requirements:

read a matrix text file and display it in rows and columns.

I don't understand what I am doing wrong, so any help would be greatly appreciated

135456634657687457834235781543783254354154534769834783782300000000000000000000000000000000000000000000000000000000000000 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ress any key to close this window ... Now write a program that performs the following tasks: - Prompt the user for a file name - Accept that file name - Open the file for input (and exit if the file is not found) - Read the data in the file - Display the data as a table, in nice neat rows and columns Everything you need to know is here and in the previous dem

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!