Hey guys, I'm struggling a bit to combine templates and operator overloading.
I'm writing a program that will be able to perform various matrix arithmetic at the end. However I'm stuck at the overloaded << and >> functions. I've defined them as I'm used to, without working with templates, however they are incorrect as I have defined them, and I'm not sure how to fix it.
I want to overload the stream insertion operator >> to read matrix data from either the keyboard or a file stream. I want to use >> to input a 3 x 3 matrix stored in a text file in the following format:
2 4 3
5 2 3
7 1 0
And similarly I want to overload the stream extraction operator << to output a matrix to the screen or file in the following format:
3 2 -1
1 -1 2
2 3 -1
As I am very new to these concepts I'm not sure how to do this at all, any help will be greatly appreciated!!
> As I am very new to these concepts I'm not sure how to do this at all, any help will be greatly appreciated
> //These declarations are incorrect, don't know how to fix or implement: