I am trying to overload the << operator a matrix class and am having some difficulty.
I read in data for the two matrices and read the data back:
int rows1, columns1, rows2, columns2;
cout << "Enter the number of rows and columns for the first matrix: " << endl;
cin >> rows1 >> columns1;
cout << "You entered " << rows1 << " rows" << " and " << columns1 << " columns for the first matrix." << endl;
cout << "\nEnter the number of rows and columns for the second matrix: " << endl;
cin >> rows2 >> columns2;
cout << "You entered " << rows2 << " rows" << " and " << columns2 << " columns for the second matrix." << endl;
I then try to output the matrices:
cout << matrix1;
cout << matrix2;
I was not getting any output, so I created a buffer. The buffer reads:
c:\users\ragan e. lake\documents\visual studio 2015\projects\assignment2rl_test3\assignment2rl_test3\main.cpp(132): warning C4715: 'operator<<': not all control paths return a value
Research online said that there is not a value for the control path, so I added an if else statement to see if my variables for number of rows and number of columns were not being populated.