Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > const char** to char*const[]?

Reply
Thread Tools

const char** to char*const[]?

 
 
Philip.J.Yoon@gmail.com
Guest
Posts: n/a
 
      10-03-2007
Hello,

I have two functions:

void function1(char* const names[]);

void function2(const char** names)
{
//do other stuff

function1(names);

//do more stuff
}

My compiler (VS2005 C++) gives me "cannot convert parameter 1 from
const char** to char * const[]", which I'd expect. My question is how
do I convert from const char** to char* const[]? It's been a while
since I've programmed in C++.

Thanks.

 
Reply With Quote
 
 
 
 
Philip.J.Yoon@gmail.com
Guest
Posts: n/a
 
      10-03-2007
On Oct 3, 9:14 am, (E-Mail Removed) wrote:
> Hello,
>
> I have two functions:
>
> void function1(char* const names[]);
>
> void function2(const char** names)
> {
> //do other stuff
>
> function1(names);
>
> //do more stuff
>
> }
>
> My compiler (VS2005 C++) gives me "cannot convert parameter 1 from
> const char** to char * const[]", which I'd expect. My question is how
> do I convert from const char** to char* const[]? It's been a while
> since I've programmed in C++.
>
> Thanks.


Hmm, nevermind this. char** must be equivalent to char*const[]. When I
took const out of const char**, the compiler stopped complaining.

 
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