#include <iostream>
int foo(const char* keke) {
std::cout << keke;
return 0;
}
int main()
{
char* keke = new char(10);
char* const haha = keke;
return foo(haha);
}
Why there is no any errors/warning while compiling the above code?
The type of haha
is char* const
, while foo
only receive argument of type const char*
. Could char* const
implicit convert to const char*
?