Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Learning C++ const reference

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:

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?

Name: Anonymous 2011-12-10 12:05

>>5
Again, for the second time you stupid fucker, no one here really knows because you didn't post any god damn fucking working code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List