Hi all, I have a C++ query.So I want to read a 'comma' separated matrix from a text file...and put the matrix into a 2d Array. | SoloLearn: Learn to code for FREE!

+1

Hi all, I have a C++ query.So I want to read a 'comma' separated matrix from a text file...and put the matrix into a 2d Array.

fstream ,sstream

c++

6/1/2020 1:17:05 PM

Jeffrey Solomon Maluleka

1 Answer

New Answer

+1

use two for loops, one inside the other. the outer for loop increments when you read a new line from the file. the inner for loop increments as you read the values between the commas. the counter values of the for loops will represent the position in the matrix at any given point in the process.