So for a project we have we have to be able to use the "at" function to return a element for a Matrix. I get how to find the element in the Matrix, I just need some help with the syntax.
In our header file the line that defines the at function is:
double & at(uint row, uint col);
How would I define this in my .cpp file? Right now I have:
double Matrix::& at(uint row, uint col){}
I'm pretty sure that's wrong though.
As for what I'm going to do in the function, I should be able to call my copy constructor and then just return the elements in array[row][col]
I implemented it exactly that way but I keep getting a weird error "undefined reference to `Matrix::at(unsigned int, unsigned int) const' " I have no idea why
It does the same thing. However, now that I get it working and try implementing it, whenever I create more than 1 Matrix object it nowgives me a segmentation error