Time to learn to use your debugger. It will show you exactly what your program is doing and why. That's what any of us would do and it's absolutely indispensable. You cannot write working programs without it. It's not optional.
Printable View
There's always 'rhyme and reason' to what a program does based upon the code it executes (unless you have a faulty CPU or compiler, which has a probability so close to 0 it can be discounted). The computer, when executing the program, does exactly what it has been told to do - no more and no less. If the program produces output which is at variance with what is expected then either the expectation is wrong or the program is at fault. In your case, you seem to have no knowledge of what the program is supposed to do! So your first step is to look at the program code and walk through it with the debugger as needed and deduce what is its function. You are correct that it performs operations on matrices - but what's that got to do with network socket programming?? If you look at the Input function, you can see that the first number requested is for the number of arrays to be used. Then for each array, it requests the number of rows and the number of columns and then inputs a value for each for these rows and columns. Then repeats for the next array etc.
This should help to make it more clear for you as to the input it requires.
Now you just have to determine what the other functions do (by inspecting the code, walking through it and using the debugger) and then you'll know what the program is supposed to do and what the output means! None of us knows by simply looking at the code what it is supposed to do. We would have to do the same as you and walk through it and use the debugger. A knowledge of matrix mathematics would also be useful!Code:void Input(int &numsMtrx, Mtrx *Mtrx)
{
int i,
j,
k;
cout << "How many matrices :";
cin >> numsMtrx;
cin.ignore(1000, '\n');
for(i = 0; i < numsMtrx; i++) {
cout << "How many rows for matrix " << i << ": ";
cin >> Mtrx[i].numRows;
cin.ignore(1000, '\n');
cout << "How many columns for matrix " << i << ": ";
cin >> Mtrx[i].numCols;
cin.ignore(1000, '\n');
for(j = 0; j < Mtrx[i].numRows; j++) {
for(k = 0; k < Mtrx[i].numCols; k++) {
cout << "Value for matrix " << i << " column " << k << " row " << j << ": ";
cin >> Mtrx[i].array[j][k];
cin.ignore(1000, '\n');
}
}
}
}