R
Rob
Hi,
I receive the following compile error.
c:\..\Blah.cpp(52) : error C2440: 'initializing' : cannot convert from
'const char *const [64]' to 'char ** '
Conversion loses qualifiers
< outside of main>
enum { sz = 64};
const char* const names[sz] =
{ "Frodo", "Gollum", "Sam", "Treebeard",
"King", "Garcia", "Burdine",
"Eriksen", NULL };
<within main>
<line 52> for (char** p = names; *p; p++)
{;}
I thought names was a pointer to an array of string literals, whose
values could not be change, nor could the location where names pointed
to be changed.
With char** p, I'm trying to point to where names points to. Please
explain where I've gone wrong.
Thanks,
Rob
I receive the following compile error.
c:\..\Blah.cpp(52) : error C2440: 'initializing' : cannot convert from
'const char *const [64]' to 'char ** '
Conversion loses qualifiers
< outside of main>
enum { sz = 64};
const char* const names[sz] =
{ "Frodo", "Gollum", "Sam", "Treebeard",
"King", "Garcia", "Burdine",
"Eriksen", NULL };
<within main>
<line 52> for (char** p = names; *p; p++)
{;}
I thought names was a pointer to an array of string literals, whose
values could not be change, nor could the location where names pointed
to be changed.
With char** p, I'm trying to point to where names points to. Please
explain where I've gone wrong.
Thanks,
Rob