Question: I am supposed to perform a matrix calculation using pointers in c++, the function works fine with square matrices, however in some cases it gives

I am supposed to perform a matrix calculation using pointers in c++, the function works fine with square matrices, however in some cases it gives me wrong result, for example for a multiplication between two matrices with sizes 3*2 and 2*5, what am I doing wrong? this is my function:

I am supposed to perform a matrix calculation using pointers in c++,

float* temp = new float [row1 * col2] ; for (int i = 0; i

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 Programming Questions!