Oops...I just missed a point in previous post. Anyway the loop gotta look like this.
//take matrices values before starting
for (int i=0; i<6; i++)
{
for (int j=0; j<6; j++)
{
M[i][j] = 0;
for (int k=0; k<6; k++)
{
M[i][j] += m1[i][k] * m2[k][j];
}
cout << M[i][j] << " "; // this is what i missed to tell
}
cout<<endl;
}
> your infile method
That method I dont suggest. Take matrices values rows by rows only, so that there isnt any confusion.
Last edited by vishesh; Apr 5th, 2009 at 11:32 am.
Reputation Points: 85
Solved Threads: 42
Nearly a Posting Virtuoso
Offline 1,362 posts
since Oct 2006