This is for an assignment and I am completely lost. The program compiles in visual studio professional 2015 then when I use the the = operator in Matrix.cpp line 78 the program crashes. Visual studios debugging is not helping. Code below.
Thanks in advanced.
Main.cpp
<#include"Matrix.h"
int main()
{
Matrix matrix1;
Matrix matrix2;
int row, col;
cout << "Please enter the size of the first matrix separating the rows and columns by a space (i.e. row col)." << endl;
cin >> row >> col;
matrix1.setRowSize(row);
matrix1.setColSize(col);
matrix1.setName("Matrix 1");
cout << "Please enter the size of the second matrix separating the rows and columns by a space (i.e. row col)." << endl;
cin >> row >> col;
matrix2.setRowSize(row);
matrix2.setColSize(col);
matrix2.setName("Matrix 2");
matrix1.inputValues();
matrix2.inputValues();
Particularly while learning C++, if only one compiler is being used, strongly favour the LLVM front-end over the GNU and Microsoft offerings. Ideally compile the code with more than one compiler, with warnings set to a high level, and demanding standard conformance.
With -Wall -Wextra -pedantic-errors, clang++ emits a diagnostic:
warning: variable 'j' used in loop condition not modified in loop body