Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > can't convert char* to const char* !?

Reply
Thread Tools

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

 
 
Gernot Frisch
Guest
Posts: n/a
 
      09-25-2006
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);}




 
Reply With Quote
 
 
 
 
Marcus Kwok
Guest
Posts: n/a
 
      09-25-2006
Gernot Frisch <(E-Mail Removed)> 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-lit...html#faq-18.17

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
 
Reply With Quote
 
 
 
 
Kaz Kylheku
Guest
Posts: n/a
 
      09-25-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const vector<const MyType> Vs const vector<MyType> magnus.moraberg@gmail.com C++ 2 02-09-2009 10:45 PM
is const necessary in eg int compar(const void *, const void *) lovecreatesbeauty@gmail.c0m C Programming 26 11-10-2008 09:47 PM
const correctness - should C++ prefer const member over non-const? fungus C++ 13 10-31-2008 05:33 AM
const vector<A> vs vector<const A> vs const vector<const A> Javier C++ 2 09-04-2007 08:46 PM
Casting int'** to 'const int * const * const' dosn't work, why? Jonas.Holmsten@gmail.com C Programming 11 07-01-2007 06:16 PM



Advertisments