Date: Mon, 30 Jul 2001 08:53:07 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Rafal Maj (Raf256)" cc: djgpp AT delorie DOT com Subject: Re: char*[] -> const char** conversion In-Reply-To: <9k21p0$flc$8@info.cyf-kr.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 30 Jul 2001, Rafal Maj (Raf256) wrote: > Why this simple code : > > #include > /*const*/ char *napis[] = {"abc","12","xxx"}; > void fun(const char** ptr) { } > main() { fun(napis); } > > generates under DJGPP (based on gcc 2.9) error : > > bug.cc(4) Error: passing `char **' as argument 1 of `fun(const char **)' > adds cv-quals without intervening `const' I think this is a standard issue with C++: const char and char are not the same, and you aren't allowed to mix them. Even C compilers print warnings about that nowadays.