1
void foo(const char **p)
{

}

int main()
{
    char *t;
    foo(&t);

    return 0;
}

This code doesn't compile (http://ideone.com/2NHA08) on gcc (error: invalid conversion from ‘char**’ to ‘const char**’ [-fpermissive]), but why? Conversion is an addition of const-ness, why can it fail?

hate-engine
  • 2,300
  • 18
  • 26

0 Answers0