I am having trouble reading the second matrix from my file. Can anyone help me please? Thank you!
vrga 0 Newbie Poster
Recommended Answers
Jump to PostJust how big are your matrices supposed to be? What is the input data. From your code, I see two sizes:
for (i =0; i<9; i++) { in >> num1 >> num2 >> num3; { RowA.push_back(num1); RowA.push_back(num2); RowA.push_back(num3); MatrixA.push_back(RowA); RowA.clear(); } } for(int i=0; i<3; i++) { …
Jump to PostSince you are reading in 3x3 matrices, your loops should do just that. You have one input statement reading three values, so loop that just three times, not nine.
All 5 Replies
stilllearning 148 Posting Whiz
vmanes 1,165 Posting Virtuoso
vrga 0 Newbie Poster
vmanes 1,165 Posting Virtuoso
vrga 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.