can't convert char* to const char* !?

Discussion in 'C++' started by Gernot Frisch, Sep 25, 2006.

  1. GLcharARB* pC;
    glShaderSourceARB(m_Shaders[index][2], 1, &pC, NULL);

    error C2664: 'void (GLhandleARB,GLsizei,const GLcharARB ** ,const
    GLint *)' :
    cannot convert parameter 3 from 'GLcharARB **__w64 '
    to 'const GLcharARB ** '
    Conversion loses qualifiers

    This works:
    const GLcharARB** ppA;
    memcpy(&ppA, &pVert, sizeof(char*));
    glShaderSourceARB(m_Shaders[index][1], 1, ppA, NULL);

    What have I done?

    Using VC7.1 here.

    --
    -Gernot
    int main(int argc, char** argv) {printf
    ("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
    Gernot Frisch, Sep 25, 2006
    #1
    1. Advertising

  2. Gernot Frisch

    Marcus Kwok Guest

    Gernot Frisch <> wrote:
    > GLcharARB* pC;
    > glShaderSourceARB(m_Shaders[index][2], 1, &pC, NULL);
    >
    > error C2664: 'void (GLhandleARB,GLsizei,const GLcharARB ** ,const
    > GLint *)' :
    > cannot convert parameter 3 from 'GLcharARB **__w64 '
    > to 'const GLcharARB ** '
    > Conversion loses qualifiers


    This is covered in the FAQ:
    http://www.parashift.com/c -faq-lite/const-correctness.html#faq-18.17

    --
    Marcus Kwok
    Replace 'invalid' with 'net' to reply
    Marcus Kwok, Sep 25, 2006
    #2
    1. Advertising

  3. Gernot Frisch

    Kaz Kylheku Guest

    Gernot Frisch wrote:
    > cannot convert parameter 3 from 'GLcharARB **__w64 '
    > to 'const GLcharARB ** '
    > Conversion loses qualifiers


    [ snip ]

    > What have I done?


    You lied in your subject line.
    Kaz Kylheku, Sep 25, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abhijit Bhadra
    Replies:
    2
    Views:
    7,460
    Ron Natalie
    Dec 1, 2004
  2. Replies:
    24
    Views:
    829
    Netocrat
    Oct 30, 2005
  3. Steven Woody
    Replies:
    1
    Views:
    506
    Michael Mair
    Jan 14, 2006
  4. lovecreatesbeauty
    Replies:
    1
    Views:
    1,043
    Ian Collins
    May 9, 2006
  5. Javier
    Replies:
    2
    Views:
    561
    James Kanze
    Sep 4, 2007
Loading...

Share This Page