Hello, everybody! I have a problem with dynamic massive. My task was to find the multiplication of positive matrix elements with using indexes and seperated compiling.
Compiler doesn't warn me about any mistake, but result is not right, it is even not a number.
Can someone tell me what did I do wrong here?
#include "Header.h"
int main()
{
int m, n;
float **r;
cin >> m >> n;
r = newfloat*[m];
for (int i = 0; i < m; i++)
r[i] = newfloat[n];
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> r[i][j];
cout << "\nMultiplication " << multi << endl;
for (int i = 0; i < m; i++)
delete[]r[i];
delete[]r;
system("pause");
return 0;
}
#include "Header.h"
int main()
{
int m, n;
float **r;
cin >> m >> n;
r = newfloat*[m];
for (int i = 0; i < m; i++)
r[i] = newfloat[n];
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> r[i][j];
multi (m, n, r);
cout << "\nMultiplication " << multi << endl;
for (int i = 0; i < m; i++)
delete[]r[i];
delete[]r;
system("pause");
return 0;
}