Possible Duplicate:
Implicit cast from char** to const char**
Given the following code:
void foo( const char ** buffer );
void bar()
{
char * buffer;
foo( &buffer );
}
Why is it that if the foo()
function has a const char *
parameter the compiler doesn't complain when passing in a char *
variable into it? But when using char **
, it cannot convert it to const char **
? Does the compiler add any const
qualifiers in the former case?
I've read section 4.4 of the C++ standard and it just confused me further.