Name: Anonymous 2011-12-10 11:09
Hi, guys... I'm trying to learn C++ and OpenGL...
I want to return the first pointer of the array... but maintaing the const correctness...
it happened that:
gives me this compiler error:
can you help me out in understanding the const correctness?
I want to return the first pointer of the array... but maintaing the const correctness...
it happened that:
class Foo{
private:
GLint array[64][64][4];
public:
const GLint& get_array(){return array;}
}gives me this compiler error:
/Users/Pella/Desktop/c/OpenGL_Nehe_cpp/CheckImag.h:28:0 /Users/Pella/Desktop/c/OpenGL_Nehe_cpp/CheckImag.h:28: error: invalid initialization of reference of type 'const GLubyte&' from expression of type 'GLubyte (*)[64][4]'can you help me out in understanding the const correctness?