5

I've searched around and so far I haven't found a satisfactory answer to this question.

Why do these compile:

char c;
char const * d = &c;

char e;
char * const f = &e;

char* g;
char* const * h = &g;

but this doesn’t?

char* a;
char const ** b = &a;

error: invalid conversion from 'char**' to 'const char**'

johnnyRose
  • 7,310
  • 17
  • 40
  • 61
Mat Bess
  • 111
  • 7

0 Answers0