delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/29/18:15:24

From: "Rafal Maj (Raf256)" <raf256 AT go2 DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: char*[] -> const char** conversion
Date: Mon, 30 Jul 2001 00:11:10 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 14
Message-ID: <9k21p0$flc$8@info.cyf-kr.edu.pl>
NNTP-Posting-Host: d-94-53-22.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 996444768 16044 149.156.1.182 (29 Jul 2001 22:12:48 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: Sun, 29 Jul 2001 22:12:48 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Why this simple code :

#include <iostream.h>
/*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'



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019