product between two bidimensional arrays

Jun 27, 2015 at 3:45pm
How can i make a product between two bidimensional arrays? Obviously if i can...

Jun 27, 2015 at 4:04pm
What is a product of two bidimensional array is?
What do you want to do exactly?
Jun 28, 2015 at 9:10am
int array1[2][2]={0,1,2,3};
int array2[2][2]={4,5,6,7};

array1*array2=????????

i want to do this but i don't know how...
P.S. Sorry but i'm not so good at english speaking ;)
Jun 28, 2015 at 9:32am
Waht is the product of arrays? Scalar product of elements? Matrix product? Something else? We cannot help you if we do not know what result should be.
Jun 28, 2015 at 9:55am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>

using namespace std;

int main()
{
    int array1[4][4]={{0,1,2,3},{9,3,4,2},{3,2,1,8},{3,1,4,7}};
    int array2[4][4]={{4,5,6,7},{4,4,2,3},{1,2,5,4},{9,4,2,4}};
    int array3[4][4]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};   // save the product

    // array3 = array1 * array2
    for (int j=0; j<4; j++){
        for (int i=0; i<4; i++){
            array3[i][j] = array1[i][j] * array2[i][j];
            cout << array3[i][j] << " = " << array1[i][j] << " * " << array2[i][j] << endl;
            cout << endl;
        }
    }


    return 0;
}

Jun 28, 2015 at 12:29pm
Thank you
Topic archived. No new replies allowed.