const char** to char*const[]?

Discussion in 'C++' started by Philip.J.Yoon@gmail.com, Oct 3, 2007.

  1. Guest

    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.
     
    , Oct 3, 2007
    #1
    1. Advertising

  2. Guest

    On Oct 3, 9:14 am, 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.
     
    , Oct 3, 2007
    #2
    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. Thomas Matthews
    Replies:
    5
    Views:
    2,550
    tom_usenet
    Aug 2, 2004
  2. Santa
    Replies:
    1
    Views:
    1,158
    Mark A. Odell
    Jul 17, 2003
  3. Replies:
    24
    Views:
    905
    Netocrat
    Oct 30, 2005
  4. lovecreatesbeauty
    Replies:
    1
    Views:
    1,151
    Ian Collins
    May 9, 2006
  5. Javier
    Replies:
    2
    Views:
    623
    James Kanze
    Sep 4, 2007
Loading...

Share This Page