Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   const char** to char*const[]? (http://www.velocityreviews.com/forums/t541682-const-char-to-char-const.html)

Philip.J.Yoon@gmail.com 10-03-2007 01:14 PM

const char** to char*const[]?
 
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.


Philip.J.Yoon@gmail.com 10-03-2007 01:42 PM

Re: const char** to char*const[]?
 
On Oct 3, 9:14 am, Philip.J.Y...@gmail.com 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.



All times are GMT. The time now is 11:22 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.