c++ - const char* const* problem
- Sanel (38/38) Sep 27 2004 Hello,
- Scott Michel (3/6) Sep 28 2004 Known bug, reported bug, awaiting fix (except mine is with void, not cha...
- Sanel (4/10) Sep 29 2004 Thanks.
Hello, i have strange problem with overloading function that accept const char* const* and char* const* arguments. Here is sample: void func(const char* const* D) { printf("%s\n", D[0]); } void func(char* const *D) { func((const char* const*)D); } int main() { char * D[]={"bla", "bla2"}; func(D); return 0; } When i try to compile it i got : func((const char* const*)D); ^ const.cpp(13) : Error: ambiguous reference to symbol Had: func(char const *const *) and: func(char *const *) func(D); ^ const.cpp(19) : Error: ambiguous reference to symbol Had: func(char const *const *) and: func(char *const *) --- errorlevel 1 Hm, strange; but when i place: void func(char* const D[]) or void func(const char* const D[]) compilation pass. It seems that compiler can't distiguish bettwen const char* const* and char* const* types. Other compilers (gcc, vc, borlandc++) support this. I tested with 8.38 and 8.41 Solutions (except casting) ? Thanks. Sanel
Sep 27 2004
Sanel <Sanel_member pathlink.com> wrote:Hello, i have strange problem with overloading function that accept const char* const* and char* const* arguments. Here is sample:Known bug, reported bug, awaiting fix (except mine is with void, not char). -scooter
Sep 28 2004
Thanks. Hope fix come soon. Sanel In article <cjcork$306p$1 digitaldaemon.com>, Scott Michel says...Sanel <Sanel_member pathlink.com> wrote:Hello, i have strange problem with overloading function that accept const char* const* and char* const* arguments. Here is sample:Known bug, reported bug, awaiting fix (except mine is with void, not char). -scooter
Sep 29 2004