Original Post
Hi im using c++, I've got a function in my class that is supposed to return a two dimensional array. eg: I'm returning const, as because so the weights can't be changed from outside the class(class design reasons). But I get this error when I try it:
class Layer {
private:
float **weights;
public:
const float **Layer::getWeights() {
return weights;
}
Quote:When I have a one dimensional pointer array, it works fine, but why can't I do it with a two dimensional pointer array, and what are the possible solutions for this problem? Thank you.
c:\my\new\nnback\layer.cpp(122) : error C2440: 'return' : cannot convert from 'float **' to 'const float **' Conversion loses qualifiers