Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - const char* const* problem
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: 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: Sep 29 2004
|