Hi, I would really appreciate any help for this as I am struggling a little to get my head around this, so I am essentially trying to get a value from a 'Matrix' that is created. Using a function in the class where the matrix is created. But when trying to do this I get the error: Call to non-static member function without an object argument in this line when trying to call the function:
Matrix::get(sizeR, sizeC);
Let me know if you need more, and I will be happy input whatever !
Is the function a private member of the class Matrix? If so, you can't call it from outside other methods in the class. make it public and you'd be able to call it using b.get( a, b) inside of main.
Nope, all are public, is it something to do with actually having this function inside of the class which is a constructor class for the matrix? As it is still giving me the same issue
Are you saying that you saying that Matrix is a subclass of ConstructMatrix? If so, does the function access private members of the ConstructMatrix class? If that is the case, then you're having a problem with inheritance. Subclasses can't inherit private members of the parent class, so whatever values the get function is trying to access need to be protected rather than private at the very least.
Oh okay, that may be the issue actually, as yeah the constructMatrix is within the matrix class, and a variable is used in the class and then changed in the subclass construct. I may just rewrite it and see if I can get my head around this, but please continue to try help, as it would be much more convenient! :P