Reading a matrix from a text - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Reading a matrix from a text

mechanix2012mechanix2012 Posts: 2Member
I recently ran into this the other day, I'm not that good of a programmer, and the teacher asked us to make a program that reads a square matrix from a txt. and then use the information to solve it. I've been wondering how to do the first part of this program as I already figured it out how to solve the matrix, but I just don't know how to do the scanning of the text. Just so you guys can understand me, this is how the text would look like:


1 2 3 8
7 4 1 2
1 2 1 2
3 4 5 6

So as you can see, it has to read the first number and store it in a variable so the program knows the size of the matrix and then read the matrix and store it in an array or so I think.

Any help would be apreciated.
Sign In or Register to comment.